Programming and Scripting :: tiny lua-fltk script



Just messing around, seeing how small I can make some useable tools.

This is a simple "run" dialog, 155 bytes (opposed to grun's 30k).
Since lua-fltk calls "sh -c" for its execute command, it should support any bash syntax (keyword "should"...i've tested only environment variables).
Code Sample
#!/bin/flua
w=Window{200,24}
i=Input{0,0,200,24;when=When.enter_key}
function i.callback()
c=i.value
if c>"" then
execute(c.." &")
exit()
end
end
w:show()

is there any detailed documents about flua?
i want to use it create some simple graphical dialog in dsl.

I'd recommend going with MurgaLua rather than Lua-FLTK.  The latter is pretty much a dead project. MurgaLua is a new project, using the latest stable versions of Lua and FLTK.
http://www.murga.org/devPages/murgaLua/index.html
In addition to this, DSL tools are (apparently) being ported over to ML. I have no idea how long this process will take, as there are many Lua files in DSL.

Neither project is well documented in itself, but you can learn a lot from the documentation of the individual Lua and FLTK packages.  The trick is to figure out how the grammar used in each works together.  The FLTK docs focus entirely on C++ syntax, so you have to figure out how to use Lua to control the FLTK widgets.  Maybe it's not a difficult task for a "true" programmer, but I've been finding parts of it very confusing.

There is another thread in this programming forum in which I've been posting ML scripts as I learn new things about it.  Maybe that will help as well.

thanks!
Now i use it to create some graphic programs.

i create a simple dialog using flua script.
it contains a button(OK) and a input text(address).
i use address.value get the input text.(it's a address of a http server).
when entering the button OK.the program will download a file.

the command is:
execute('wget -P /usr/ http://address.value/***')

*** is the file name.
is error is : the program can't resolving the address.value .the program can't download the file.
so how could I write the command?

i got it.
execute('wget -P /usr/ http://'..adress.value..'***')
the .. conbinate two strings.

Next Page...
original here.