What is your favorite Lua GUI toolkit?

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

Re: What is your favorite Lua GUI toolkit?

Pavel Holejsovsky-2
On 2/9/2011 3:16 PM, Alex Bradbury wrote:
> On 9 February 2011 13:04, Pavel Holejsovsky<[hidden email]>  wrote:
>> realized that dynamic approach would be better - uses binary .typelib files
>> at runtime to lookup function and type info and calls function using libffi.
>>   At the beginning it looked simple enough (but it wasn't :-)
>
> Any idea on the call overhead? Glib+Gio provides a fairly good
> standard library if the overhead of each call is not too high, while
> it's not likely to matter much for most GUI code.

I haven't measured the overhead, but I'm afraid that it might be
significant - libffi itself is not exactly fast, and marshalling Lua
values into C-style ones might get expensive too.  As you said, it is
probably fine for most GUI usages, but might be problematic for
time-critical code.

Also, have you
> looked at the in-development LuaJIT2 FFI API and considered if it
> might at some point be possible to make use of that rather than
> libffi?

I'm watching LJ2 FFI and planning to use it.  Ideally it should provide
as fast calling sequence as native C code, if not faster.  Once FFI gets
callback support and some nice __gc support (and I finish features of
the rest of LGI), I'll start porting. The lgi architecture is hopefully
roughly prepared for it - it is divided to 'core' which is in C and is
basically wrapper around libffi, GI and marshalling, and the rest of the
code is already in Lua.  Replacing currently-in-C-written core with
Lj2FFI based one will hopefully do the trick.

Pavel


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Mateusz Czaplinski
In reply to this post by steve donovan
On Wed, Feb 9, 2011 at 11:54 AM, steve donovan
<[hidden email]> wrote:
> LuaInterface WinForms is easier, but I don't know what the status on Mono is.

If you mean Mono licensing itself, then last time I checked I was
surprised to read it's pretty liberal: the libraries were IIRC
BSD-like (actually, that allowed me to cut a fragment of .NET 3
library implementation and paste it into a .NET-2-compatible closed
source C# app), only the compiler & rest of tools are some GPL or
something.

greetings
Mateusz Czapliński

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Steve Litt
In reply to this post by Stuart P. Bentley
On Wednesday 09 February 2011 01:29:22 Stuart P. Bentley wrote:
> ?I'm all about IUP. As far as I'm concerned, it's the perfect interface
> library.

Then let me ask you something. The IUP website seemed to say you have to write
your callbacks in C or C++. Can you write them in Lua also? If so, do you have
to do all that C infrastructure to get the framework to recognize the Lua, or
can you just write Lua callbacks?

I like the fact that IUP has only 100 functions.

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Steve Litt
In reply to this post by Dirk Laurie
On Wednesday 09 February 2011 02:32:42 Dirk Laurie wrote:
> On Wed, Feb 09, 2011 at 03:44:02AM +0200, Steve Litt wrote:
> > Conceptually I put up a window and lay down textboxes, dropboxes,
> > checkboxes, radio buttons and the like on it. I don't care whether I do
> > it graphically or with specifications, but I sure don't want to try to
> > memorize hundreds of functions to make a dialog box.
>
> What GUI were you using before getting into Lua?
>
> D.

My opinion -- in Linux, the pickings are so slim I bend over backwards not to
go GUI. When I *have* done GUI, it's been mainly Perl-Tk or Lazarus. Perl-Tk
is too messy, and Lazarus is good an easy but too black-boxy.

Back in my Windows days I liked Powerbuilder, but of course Powerbuilder cost
$600 and was kind of crashy.

In other words, I'm looking for something better than anything I've ever used
:-)

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Steve Litt
In reply to this post by steve donovan
On Wednesday 09 February 2011 02:39:59 steve donovan wrote:

> On Wed, Feb 9, 2011 at 9:31 AM, Dirk Laurie <[hidden email]> wrote:
> > I agree with your assessment of Qt.  Plus, it's as close to being
> > platform-independent as GUI's get.  Great to hear about the Lua
> > port.  I'll try it out immediately.
>
> Is there still licensing issues for commercial use of Qt?
>
> Every now and then, one _does_ do something for money ;)
>
> steve d.

I think so. But then again, the same is true of GPL.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

steve donovan
In reply to this post by Steve Litt
On Wed, Feb 9, 2011 at 7:59 PM, Steve Litt <[hidden email]> wrote:
> I like the fact that IUP has only 100 functions.

Yes, it's an excellent number. To answer the question, yes just about
everything can be done in Lua.

The website can be a bit confusing, since you have to make a mental
translation into what form the Lua version would look like....

(You might rather like ltcltk in fact, since I bet you it's cleaner
than the Perl binding ;) I've tried most of the toolkits out there,
and eventually they blur together. But tk is one of the friendliest -
I did stuff using it with Tkinter with Python.)

steve d.

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Steve Litt
In reply to this post by David Given
On Wednesday 09 February 2011 06:44:35 David Given wrote:

> On 02/09/11 00:37, Rob Kendrick wrote:
> [...]
>
> > It would be ncurses, but nobody's written a binding for it yet that
> > doesn't make me want to spurt poisonous bile from my nipples.
>
> You might want to get that looked into...
>
> I'm quite happy with the curses-based GUI wot I wrote for WordGrinder,
> although it's very simple. To run a dialogue you just do:
>
> local dialogue = {
> title = "Title goes here"
> width = Form.Large, -- just smaller than screen
> height = 12, -- or absolute value,
>
> -- Arbitrary keybindings
> ["KEY_RETURN"] = function() return "confirm" end,
> ["KEY_ENTER"] = "confirm",
> ["KEY_^C"] = "cancel",
>
> -- Widgets:
> Form.Label {
> -- bounding box. Negative numbers go from
> -- opposite side of dialogue
> x1 = 1, y1 = 2,
> x2 = -1, y2 = 2,
> align = Form.Left,
> text = "Hello, world!"
> },
>
> Form.TextField {
> x1 = 1, y1 = 5,
> x2 = -1, y2 = 5,
> value = "Initial value of text field"
> }
> }
>
> Then you do:
>
> local result = Form.Run(dialogue, RedrawScreen)
>
> RedrawScreen is a function that draws what's behind the dialogue, and it
> returns a value indicating whether the dialogue was confirmed or
> cancelled. Typically I call this in a loop that validates the values the
> user put into the dialogue.
>
> The whole thing's about 600 lines of code, not including the curses
> drawing routines. Widgets can be customised by overriding methods on the
> widget instantiation. I'm fairly pleased with the general Lua-ness of it.
>
> There's a bunch of stuff wrong with it, mainly in that it handles
> screens too small for the dialogue rather ungracefully, and of course
> the total lack of documentation, polish, and the fact that it's
> integrated into WordGrinder and intended for dialogues only; I have
> other stuff I want to write using it, and so have vague plans to
> abstract it into a proper library at some point.
>
> Code here:
>
> http://wordgrinder.hg.sourceforge.net/hgweb/wordgrinder/wordgrinder/file/f6
> 58d1e8f1f3/src/lua/forms.lua
>
> Example here (starting at line 100):
>
> http://wordgrinder.hg.sourceforge.net/hgweb/wordgrinder/wordgrinder/file/f6
> 58d1e8f1f3/src/lua/addons/autosave.lua

Hi David,

If that were GUI instead of Curses, I'd be on it like a squirrel on a tree.
Everything on there is something you type into, select from, or choose, or a
property of one of those. It maps well to what's presented to the user. It
requires a minimum of wizardly incantations.

I don't quite see how it interfaces to nCurses. How does it do that?

You know, it's too bad you don't have some sort of translator that takes code
destined for your nCurses thing and turns it into some sort of GUI source
code.

Thanks

SteveT


Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

BogdanM
On Wed, Feb 9, 2011 at 8:55 PM, Steve Litt <[hidden email]> wrote:

> Hi David,
> You know, it's too bad you don't have some sort of translator that takes code
> destined for your nCurses thing and turns it into some sort of GUI source
> code.

Well ... http://pdcurses.sourceforge.net/
Not exactly what you suggested, but I don't think it gets any closer
:) There are other libraries that implement curses in graphic mode but
I don't remember their names right now.

Best,
Bogdan

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Josh Simmons
In reply to this post by Steve Litt

Hey there. First up great stuff with your gi work. I found it the other day and wondered to what extent  it was usable at the moment? I'm interested in having a go at clutter/Mx with it (but got distracted at the time).

I basically came to the same conclusions as you the last time I looked at all this stuff, that is, I wanted a runtime gi binding similar to pygi / seed but unfortunately I didn't have the conviction to actually do anything about it.

On Feb 10, 2011 2:30 AM, "Pavel Holejsovsky" <[hidden email]> wrote:
Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Luiz Henrique de Figueiredo
In reply to this post by Steve Litt
> What is your favorite Lua GUI toolkit?

There's a list at http://lua-users.org/wiki/GraphicalUserInterfaceToolkits

I found tekUI fun, though I haven't done any GUI programming in quite a while.
        http://tekui.teklib.org/

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Steve Litt
On Wednesday 09 February 2011 14:27:37 Luiz Henrique de Figueiredo wrote:
> > What is your favorite Lua GUI toolkit?
>
> There's a list at http://lua-users.org/wiki/GraphicalUserInterfaceToolkits
>
> I found tekUI fun, though I haven't done any GUI programming in quite a
>  while. http://tekui.teklib.org/

That looks like a no-nonsense product. I'm going to try it.

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Miles Bader-2
In reply to this post by Vadi
Vadim Peretokin <[hidden email]> writes:
>> After all, for the end-user Qt and GTK+ are essentially the same.
>
> Sorry to nitpick. For the aesthetically conscious user, they aren't.

I agree that GTK+ usually looks a bit better, but in my experience, the
difference isn't large.

-miles

--
History, n. An account mostly false, of events mostly unimportant, which are
brought about by rulers mostly knaves, and soldiers mostly fools.

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Javier Guerra Giraldez
In reply to this post by Vadi
On Wed, Feb 9, 2011 at 9:41 AM, Vadim Peretokin <[hidden email]> wrote:
>> After all, for the end-user Qt and GTK+ are essentially the same.
>>
>
> Sorry to nitpick. For the aesthetically conscious user, they aren't.

thanks!!   i was starting to fear that either everybody around is
blind, or i'm seeing things!

--
Javier

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Tim Mensch
In reply to this post by Petr Štetiar
On 2/9/2011 5:12 AM, Petr Štetiar wrote:
> Why non-commercial? This looks like a FUD to me, you should read something
> about Qt and LGPL[1] first. FYI LGPL is not the same as GPL.

Strictly speaking, you can use an LGPL library in a commercial product,
but it places restrictions that some companies are uncomfortable with
(you must allow reverse engineering and relinking of your application)
and that are completely verboten on some platforms (like any console or
handheld video game unit, which pretty universally prohibit any reverse
engineering in their licenses).

The general consensus (for non-open-source software) is that such an
LGPLed lib needs to be in a dynamic library so that an end user can
build their own version and link it in. On platforms like Android or
iPhone it gets very fuzzy how one could actually comply with LGPL in a
commercial app, and as such I avoid source tainted by it, but I know
others feel differently.

Tim

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Mauro Iazzi
On 10 February 2011 05:04, Tim Mensch <[hidden email]> wrote:
> Strictly speaking, you can use an LGPL library in a commercial product,
> but it places restrictions that some companies are uncomfortable with
> (you must allow reverse engineering and relinking of your application)
> and that are completely verboten on some platforms (like any console or
> handheld video game unit, which pretty universally prohibit any reverse
> engineering in their licenses).

There are a lot of commercial products based on Qt, so the possibility
is not theoretical. None of the platform you cite are targets for Qt
so what does this have to do with the Lua bindings?

> The general consensus (for non-open-source software) is that such an
> LGPLed lib needs to be in a dynamic library so that an end user can
> build their own version and link it in. On platforms like Android or
> iPhone it gets very fuzzy how one could actually comply with LGPL in a
> commercial app, and as such I avoid source tainted by it, but I know
> others feel differently.

Again Android and iPhone are not targets of Qt. If you don't want to
touch the LGPL you surely can, but it allows commercial development,
and not in a purely theoretical way, because several commercial
applications have been created with LGPL dependencies.

In short. If GTK was an option for you, Qt can be because it has the
same license.
Regards,

mauro

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Pavel Holejsovsky-2
In reply to this post by Josh Simmons
On 2/9/2011 8:12 PM, joshua simmons wrote:
> Hey there. First up great stuff with your gi work. I found it the other
> day and wondered to what extent  it was usable at the moment? I'm
> interested in having a go at clutter/Mx with it (but got distracted at
> the time).

Hi, I think it should be usable now, although something like alpha
quality - there are definitely some bugs and "everything might change".
  There is also virtually no docs - use the samples in the meantime.
The main problem might be getting dependencies right; you will need
newest gobject-introspection (0.10.2, although 0.10.1 might work too),
and all used typelibs have to be recompiled with this version of gi
installed(!), if your want to use GTK, get at least 2.99.3.  I haven't
tried clutter yet, but since it is heavily used by gnome-shell (i.e.
through gjs javascript), it might just work out of the box.  Anyway, if
you will try it, I'd be interested in your results.

Pavel


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Iñigo Serna
Gtk+ and lgob [1].

I don't understand why lgob isn't more popular. I'ts quite easy and
very powerful.

[1] http://oproj.tuxfamily.org/wiki/doku.php?id=lgob

Regards,
Iñigo Serna

Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

David Given
In reply to this post by Steve Litt
On 02/09/11 18:55, Steve Litt wrote:
[...]
> I don't quite see how it interfaces to nCurses. How does it do that?

There's a low level API that it uses to actually do stuff on the screen.
(Then there's some Lua utility functions for drawing boxes and the
like.) The Lua bindings are here:

http://wordgrinder.hg.sourceforge.net/hgweb/wordgrinder/wordgrinder/file/f658d1e8f1f3/src/c/screen.c

This then calls the appropriate backend to do the work; the ncurses
backend is here:

http://wordgrinder.hg.sourceforge.net/hgweb/wordgrinder/wordgrinder/file/f658d1e8f1f3/src/c/arch/unix/cursesw/dpy.c

There's also an experimental GDI backend for Windows, but it still needs
work.

--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "Thou who might be our Father, who perhaps may be in Heaven, hallowed
│ be Thy Name, if Name Thou hast and any desire to see it hallowed..."
│ --- _Creatures of Light and Darkness_, Roger Zelazny


signature.asc (270 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

Steve Litt
In reply to this post by Iñigo Serna
On Thursday 10 February 2011 06:56:22 Iñigo Serna wrote:
> Gtk+ and lgob [1].
>
> I don't understand why lgob isn't more popular. I'ts quite easy and
> very powerful.
>
> [1] http://oproj.tuxfamily.org/wiki/doku.php?id=lgob
>
> Regards,
> Iñigo Serna

Probably it's not used more because of the anemic documentation. Most folks
aren't willing to spend learning time on something they can't read enough
about to find out if it will do the job, and something they can't RTFM.

If somebody wrote excellent docs on lgob I bet it would get a lot more popular
(always assuming it's good in the first place).

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt


Reply | Threaded
Open this post in threaded view
|

Re: What is your favorite Lua GUI toolkit?

steve donovan
On Thu, Feb 10, 2011 at 8:28 PM, Steve Litt <[hidden email]> wrote:
> Probably it's not used more because of the anemic documentation. Most folks
> aren't willing to spend learning time on something they can't read enough
> about to find out if it will do the job, and something they can't RTFM.

It's a common enough problem. I understood LuaGnome because I knew
enough of GTK+ to get started, and then caught the pattern, so that I
could look at the C documentation and have a reasonable idea of how
the Lua call would work.

Whereas PyGTK is well documented.  Alas, documentation is hard and
needs dedicated labor....

steve d.

1234