Higher level Lua/FLTK binding

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Higher level Lua/FLTK binding

Jay Carlson
I've written a higher level binding between Lua and FLTK. The toLua binding
I did ( http://www.place.org/~nop/lua-fltk-0.1.tar.gz ) provides a very C++
like binding.  My new code at
http://www.place.org/~nop/lua-fltk-l2-0.1.tar.gz provides a second layer,
written in Lua, that acts more like a proper Lua binding should.

Constructors are of the form Button{10,10,40,40; color=Color.blue}, and most
attribute-like things on widgets are available directly.  You can write
input_widget.value to retrieve and/or set using the Fltk value functions,
for instance.

I shamelessly borrowed the design of the shopping list application and
implemented it in this binding; it should be a reasonable example.  I'm
still trying to get a feel for what good style would be, so please pardon
the code quality.

BTW vr3framework.lua does a reasonable job of emulating the Agenda look and
feel.

Eventually I would like to move this binding to C; I'd appreciate comments
on it.

Jay


Reply | Threaded
Open this post in threaded view
|

Re: Higher level Lua/FLTK binding

Jay Carlson
Jay Carlson writes:

> I shamelessly borrowed the design of the shopping list application and
> implemented it in this binding; it should be a reasonable example.  I'm
> still trying to get a feel for what good style would be, so please pardon
> the code quality.
>
> BTW vr3framework.lua does a reasonable job of emulating the Agenda look
and
> feel.

Ooops, I realized this list doesn't have the context for this.

I've been working on embedded Linux as a hobby for a few years.  One of the
devices I work on is Agenda VR3; see http://www.agendacomputing.com or
http://www.agendacomputing.de/ .  Quick summary: the VR3 is a 66MHz
MIPS-based Linux box with 8M RAM, 16M flash, and a 160x240 greyscale
display.  It sells for $180-$250.  The standard distribution uses X and the
FLTK widget set, with some additional widgets and libraries.

I truly hate writing applications in C or C++, so I've been looking for a
plausible higher level language to use on these embedded devices.  On a
previous project, a linux distro for the VTech Helio (75MHz MIPS 8M RAM 2M
flash), I used the W window system and Tcl as a scripting language.
http://vhl-tools.sourceforge.net/ if you're curious.  For various practical
and ideological reasons I don't like Tcl much.

Jay