Programming and Scripting :: more flua script help
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.." &")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.Thank you again Mikshaw! Works great.
original here.