[sent to both lua-l and agenda-dev]
I've significantly revised the Lua FLTK bindings. Now, slotlike things on
widgets are mapped directly to table entries; this layer previously provided
by lua-fltk-l2/lwin.lua and friends is now directly supported by the tolua
bindings. (I added a "property" attribute to tolua variable bindings to map
Lua's w.bar onto C++ w->bar() and w->bar(new_value).)
A new version of flconvert is included; it now supports direct specification
of callbacks from the fluid UI designer as well.
This version has support for Fltk event hooks and timer functions, but
they're completely undocumented right now. In fact, the documentation
consists of the examples. I plan on fixing this very shortly, but at least
the examples are evocative.
Get sources from http://www.place.org/~nop/lua-fltk-0.9.tar.gz ; I'll try to
get some binaries up tomorrow.
Brian, if you're going to build this, please note the the libtolua API has
changed significantly and may do so again in the future, so I think it needs
to go into a separate .sso from liblua.a/liblualib.a . Barring major
disasters, I think the lua/fltk system defined here is good enough to
deliver; it's significantly patchable through Lua code after the fact.
Fltk bindings for lua
Jay Carlson [hidden email]
Initial version hacked together over a weekend (between rounds of
Counter-Strike). Later versions hacked together by forgoing C-S. No
Requires Lua 4.0 and a patched toLua 4.0 alpha. tolua patch in
Builds and runs on Debian 2.2, Solaris 8, Win32 using Cygwin, and the
Agenda VR3. Some assembly required, especially for the
I'm not sure whether the *.tolua fltk bindings are covered by the LGPL
or not; perhaps it's safest to assume so. Consider the rest of the
package to be covered by the terms of the lua license in lua.h.
There's an implicit Fl:run() at the end of cmdline arg execution.
However, if you start up without any args at all you need to Fl:run()
yourself once you have a window up. (Fl:run() exits if there are no
windows on screen.)
If you add -i, like "flua -i multi.lua", you'll get an interactive
shell after the scripts run.
This version maps most slot-like features of widgets to table entries,
so you can just write
if my_toggle_button.value then
my_box.label = "Pressed"
The only documentation right now is the examples; I'm working on
"There's no Fltk event handling, just callbacks. And no drawing,
either. But hey, no fltk *or* tolua code was modified!"
Wait, that's not true. There's a hook for fltk event handling now and
tolua got kinda beat up. Still can't draw.
Memory management should be solid now. Incorrect things will happen
if you depend on the values of properties or functions defined to
return Fl_Widget*, as they won't be cast back to the proper tolua tag.
flconvert is a tool to convert the UI specification files generated by
the "fluid" UI builder to Lua. An up-to-date version is in flconvert.