lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Rafael Jannone wrote:

> What I am really talking about is having some kind of standard set
> of lua data structures for GUI development, but more in a sense
> of "let's program a GTK-like toolkit using lua instead of C".
> Then you could have a number of appropriate graphical backends.

Well, you have two options: write a toolkit that uses native widgets (like 
wxWindows or Zinc), or emulate everything yourself (just about everyone 
else).

Using native widgets is more complex, but ultimately provides a better 
solution. People expect their platform to look and feel like their platform, 
be it Windows, Linux or a Mac.

One problem you run into is that certain controls are not availble 
cross-platform, so you end up having to leave them out, or having to emulate 
them somehow.

Emulated widgets is a much cleaner approach. Typically, you can use something 
like OpenGL since it's widely available. You can choose to emulate a 
platform's look and feel (like Swing does) or just choose your own look and 
feel (Swing Metal, for example).

The nice thing about emulated controls is that you generally only have one 
codebase to maintain.

That said, I think that writing a cross-platform toolkit in Lua just for the 
sake of it being in Lua isn't a very compelling project.

I say this having spent a good chunk of time writing a Win32 toolkit, and then 
sunk another chunk of time into trying to get a cross-platform toolkit 
working. Cross-platform libraries are complex, and they are never done. If 
you are wrapping native controls, you are always trying to keep up with the 
latest developments. Multiply this by several platforms, and you've got a 
huge task, even if you've got a lot of volunteers.

Tlhere are a number of excellent cross-platform toolkits available. I 
personally think it would be more useful to concentrate on using one of them. 
I'm a huge fan of wxWindows, and I think wxLua does a great job wrapping it. 

If you don't like that, write your own set of wrappers that hide the klunky C 
interface and give it a clean Lua interface. But I'd advise against starting 
a project like this from scratch.

Just my two cents.

-- David Cuny