As of now, the following choices seem to be available:
= Tk: comes with Ruby, so should be easy to deploy.
= Qt
= GTK
= JRuby plus some Java GUI, preferably SWT
= It seems there is also FXRuby (http://www.fxruby.org/)
(non-native widgetset).
For what it’s worth, there are a few examples already out there of
using JRuby with SWT and Swing that look pretty nice. It’s basically
just Ruby code in the end, and works pretty well.
I for one would really love to see some community effort to create a
standard GUI library API that can be backed by whatever library,
somewhat in the spirit of SWT. With such an API, we could have a Swing
or SWT-backed implementation in JRuby, and MRI could use GTK, QT,
win32, Cocoa, Fox, or whatever. GUI developers could build to the API,
not to the library, and it would work anywhere.
However I think Swing has shown that building a general GUI widget API
is a difficult thing to get right, and everyone’s going to have their
own preferences.
My vote goes for wxWidgets. Which there are ruby bindings I believe.
wxWidgets translate to native bindings. Or at least they should.
Check out their site: http://www.wxwidgets.org/
As of now, the following choices seem to be available:
= Tk: comes with Ruby, so should be easy to deploy.
= Qt
= GTK
= JRuby plus some Java GUI, preferably SWT
= It seems there is also FXRuby (http://www.fxruby.org/)
(non-native widgetset).
And probably wxRuby too.
Does anyone know of some objective comparisons of these
approaches? Especially with regard to learning curve,
stability, integration with Ruby, interactive GUI design,
and ease of deployment?
As I said, I am new to GUI programming, so this all looks
a bit intimidating at the moment.
Here are some pretty general guidelines that I follow:
Browse around the various project’s mailing lists. See which ones
you think tend to be the most helpful. Note, more mature toolkits with
good docs may be less active, but you can still see if user questions
are getting answered.
Have a look at the project’s docs. Whichever toolkit you go with,
you’ll be spending a lot of time with their docs.
Have a look at the project’s various sample programs. The simpler
ones are often just a page of code. Then maybe look for some sample
code that uses a feature you know you’ll be using, and see what you
think.
Finally, if they come with a GUI builder tool (like GTK’s Glade),
you might try it out. Could save you a lot of time.
well, it doesn’t need to be your stuff
I simply don’t know any application that uses it (and never looked for
one). So if you were aware of such an application, I would have tried it
gladly.
However, it looks like you do have a mac too, so I suppose if you knew
those applications, you would have tried them by yourself.
Tk is ugly, but it’s a “de facto standard” and does come built-in.
…
The app I’m building will have a Dia/Visio/XFig/Inkscape-like “drag and
drop shapes onto a canvas” GUI, but not a full diagramming package. I’ve
actually considered using one of the open-source diagramming packages as
Tk does have a rather nice 2D Canvas widget with various shapes, layers,
groups, etc. I’d love to see a similar widget in Fox…
However, it looks like you do have a mac too, so I suppose if you knew
those applications, you would have tried them by yourself.
right !
the most “live” app i’am using on mac, being not X11 dependant, are
SwingX-java and Swt-java (for X-platform).
i think also they are F-Script-Cocoa app, able to run on other platform
because Objective-C is also available over windows (by using gnustep ?)
and sure over *nix…
I may be wrong, but I’m pretty sure FOX uses X11 under OS X. (But I
don’t like how FOX looks on Windows or X as it is, so I may be biased)
From wikipedia:
Both Qt and wxWidgets have some support for programming natively on Mac
OS and Mac OS X platforms, which FOX currently does not support.
I suppose you are right.
And what about FLTK? And XUL? In fact it may be quite interesting…
Just a note about Tk – it has built-in bindings in ruby, not a
built-in toolkit. You still need the Tcl/Tk backend, which must be
installed seperately on windows or *nix or mac. Not to mention that
Tile must be installed seperately (for the tk 1.8 stable branch at
least). Unless I’ve missed something, the only thing built-in about Tk
is the bindings, not the toolkit itself.
your project’s code, plus three separate GUIs. However, the GUIs should
be pretty simple.
If you make the GUI and the rest of the project communicate using some
kind of RPC over TCP, you even get, for pretty much free, the ability to
have the GUI remote.
Or use Rails and make a browser-based GUI with Ajax.