Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: more flua script help< Next Oldest | Next Newest >
plinej Offline





Group: Members
Posts: 75
Joined: Oct. 2005
Posted: Feb. 13 2006,22:06 QUOTE

I'm working on some other scripts that I need some help on. I made an input box with the following lines:

input = Input{70,35,300,30,"scanbus #'s"}
function input:callback()
--need to add something here--
end

Now how would I get that input to be recognized in a line like this:

execute("aterm -e cdrecord blank=fast dev="..what_do_i_put_here.." &")
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Feb. 14 2006,04:00 QUOTE

You probably don't want to use an execute as the callback for an input field, as the callback is usually done with every change to the input field (every key pressed would cause the execute to run).  Best idea would be to have a button that has a callback related to the contents of the input field.
Code Sample
input = Input{70,35,300,30,"scanbus #'s"}
input_button = Button{70,65,80,30,"scanbus"}
function input_button.callback()
execute("aterm -e cdrecord blank=fast dev="..input.value.." &")
end

You'd still need some way to read the output of that command back into flua, since it doesn't work the same way that a shell like bash would...so if you redirect the command's output to a file, you can read the contents of that file back into flua if it needs to be displayed or otherwise used in your flua script.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
plinej Offline





Group: Members
Posts: 75
Joined: Oct. 2005
Posted: Feb. 14 2006,04:21 QUOTE

Thank you again Mikshaw! Works great.
Back to top
Profile PM 
2 replies since Feb. 13 2006,22:06 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: more flua script help

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code