lua-users home
lua-l archive

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



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

I don't believe in general-propose GUI toolkits for non-programmers.
But we use to build domain-specific APIs/abstractions on top of Iup/Lua.
We have achieved good results with this approach.

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

These are the main goals of Iup too. But people have different perceptions of what is simple and intuitive, and lightweight-ness changes a lot from context
to context.


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.

I don't want to argue with you whether your example is simpler than the equivalent
in Iup, but you can write almost the same thing with IupLua.
Probably, the main difference would be in the content of MyEditor.glade and how it was generated. Iup was designed following a latex-like approach, although we have a prototype
of a dialog editor for Iup.

I am not saying that Iup is a better GUI toolkit than any other (and I don't think it is).
I just want to make some points about Iup clear, so people can choose
which tool fits better their needs.

to avoid confusion: Although I am from Tecgraf too, I am not part of the Lua team.

Regards,
Renato