lua-users home
lua-l archive

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


Am Son, den 29.02.2004 schrieb David B um 04:41:
> I agree that the situation is not good.
> Fixing GUI 'situation' would assist all Lua users. 
> Some direction from the Lua authors would be good.
> Should we hang our hats on IUP?

I am not one of the lua developers. I did take a closer look to iup but
it didn't impress me much :-)
pros:
- its already there
- supports linux and windows
cons:
- homepage makes konqueror crash and looks very windows like ;-)
- library not available to debian
- doesn't comply to LTN7
- creation of dialogs buttons and so on is much more difficult as with
tcl/tk (which is not good for people who have never programmed before!)

It would be great if there was a gui library for lua. In my opinion, it
should have to follow these rules:
- simple and intuitive
- lightweight
- supports native guis

If we can live with a gui library that is 2 MB big then we could live
with wxWidgets. http://www.wxwindows.org it supports win lin and mac. in
linux you can chose between gtk and qt. There already is a wx lua
project but its also not simple enough for me.

simple means this in lua:

guiinit = loadlib("./guilib.a", "init")
guiinit()

function button1_click()
  print("edit contains this text: "..edit1.text)
end

-- no need to create the first window because its already there! 
button1 = gui.button("my buttontext", button1_click)
edit1 = gui.textedit()

-- all gui elements that are created have intelligent defaults set
-- of course you can change the attribute after creating the elements
button1.enable = 0
edit1.multiline = 1

-- as an alternative you could also add a function to the gui lib that
-- automatically shortens the gui names:
-- gui.simplenames() would do something like this:

button = gui.button
textedit = gui.textedit
-- etc.

-- The problem of the gui layout can be solved by a function that is
-- able to load xml files from glade or wxwindows editors

gui.loadlayout("./MyEditor.glade")

Now I hope that there are people on this list that share my opinion.
Since lua is simple, the gui should really be it too.

Regards
-- 
Clemens Wacha           wacha@gmx.ch           ICQ:12620942

proudly running Debian/GNU Linux. See http://www.debian.org