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
Pages: (5) </ [1] 2 3 4 5 >/

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

reply to topic new topic new poll
Topic: tiny lua-fltk script, run< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Aug. 16 2006,15:27 QUOTE

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()


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





Group: Members
Posts: 9
Joined: May 2006
Posted: Aug. 29 2006,08:28 QUOTE

is there any detailed documents about flua?
i want to use it create some simple graphical dialog in dsl.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Aug. 29 2006,14:22 QUOTE

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.


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





Group: Members
Posts: 9
Joined: May 2006
Posted: Aug. 30 2006,09:20 QUOTE

thanks!
Now i use it to create some graphic programs.
Back to top
Profile PM 
kuangtu Offline





Group: Members
Posts: 9
Joined: May 2006
Posted: Aug. 31 2006,07:53 QUOTE

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.
Back to top
Profile PM 
21 replies since Aug. 16 2006,15:27 < Next Oldest | Next Newest >

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

Pages: (5) </ [1] 2 3 4 5 >/
reply to topic new topic new poll
Quick Reply: tiny lua-fltk script

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