login

ComparingGuiToolkits (Ruby)

HomePage | RecentChanges | Preferences | Wikis | RubyGarden | Feed-icon-16x16

This is a place where we can share pros and cons of various GUI toolkits. I'm interested in objective and subjective reports based on personal experience or rumors. I'm not sure if each toolkit should have its own page. I guess as each section becomes too big, it can get refactored out. It's kind of nice to have a single place that summarizes the comparisons, though.

KevinSmith: I originally created this page, and hoped many other people would add comments. Some of the information was quite stale, so I just updated it. I removed a couple names, so if you're offended please feel free to put your name back in.


Tk. Personally, I didn't like it. I think part of my dislike comes from the Perl-like bindings, which allow two ways to configure widgets, and I don't like either of them. Having Perl-like bindings does allow one to use Perl/Tk? docs pretty effectively, which is nice. The look and feel seems a bit out-dated, and the selection of widgets (at least, out-of-the-box) seems a bit weak. Cross-platform support is great. I've heard some concerns about the health of the development community, but at least the Ruby bindings are solid.

BrianWisti -- RubyTk is not the most attractive toolkit on Unix, but it does have the advantage of being available with the standard Ruby distribution. Tk has gotten over a lot of the "X Windows only" mentality that still make it hard to use other toolkits on different platforms.


FOX. FOX has great ruby bindings, and has a good selection of widgets. The development community seems active. It runs natively on Win32 and X Windows (no extra layers), but does not use NativeWidgets.

FXRuby, the Fox/Ruby? binding, is now bundled with the WindowsInstaller distribution of Ruby (HTTP://www.rubycentral.com/downloads/ruby-install.html) produced by the Pragmatic Programmers at Ruby Central (HTTP://www.rubycentral.com/)


wxWindows. I used it in C++ for a few months, on a few small projects. It is an MFC-like full-blown framework, with document classes, string classes, etc. The development community seems pretty strong, and the C++ code base seems to be of reasonable quality. It runs directly on top of Win32, but sits over GTK or Motif on the Linux side.

It uses NativeWidgets where possible, but draws its own complex widgets when the native platform doesn't have them. On Win32 it uses all (or almost all) native widgets, but on GTK+ it draws a tree control and a list control that are like the Win32 versions. This makes cross-platform portability easier without having to just use "lowest common denominator" widgets.

There is a wrapper for the Scintilla (www.scintilla.org) syntax-highlighting text editor. Scintilla supports Ruby syntax. There were recent discussions on the mailing list about a Ruby IDE. The Scintilla support makes wxWindows an interesting possibility for writing such an IDE.

In addition to Win32 and GTK+, it also runs on the Mac, and a port to embedded systems is almost ready. There is discussion of ports to Windows CE and other platforms, but I don't think much is happening on those yet. wxWindows has been around for 10 years, and has a wide selection of widgets available.

There's a nice GUI builder, wxDesigner. It's not free, but a student license is only $19 US. It is not clear yet whether it will support wxruby. I think I heard that the author will support wxRuby when wxRuby is ready.

There's also a free glade-like GUI builder, wxGlade, written in Python. There's no mention of a ruby support on wxGlade home page, but I guess that using XRC (wxWidgets' XML resources) could be a solution/

A well regarded set of bindings for Python and also a set for Perl exist, and wxruby is finally being actively developed. wxRuby is actively being developed at: HTTP://rubyforge.org/projects/wxruby/


GTK. I used Ruby/GTK on two small projects in 2001, and it basically worked. Support for Win32 has traditionally been weak, but they're trying to improve it. Despite being written in C, it's actually very object oriented. The Ruby bindings are clean, but the bindings are close enough to the native C API that all the existing GTK documents also apply to Ruby/GTK. The development community is very strong, the widget set is pretty complete, and the general design is quite clean. Also, Unfortunately, GTK itself is somewhat complex, with large numbers of methods per class. It uses NativeWidgets on GTK (duh), but not on other platforms.

AviBryant: Ruby/GTK, unlike most (all?) of the other bindings, does work with a very good GUI builder (Glade). This can be a major advantage for rapid prototyping.

KevinSmith: Personally, I prefer to create dialogs in code, rather than with a GUI builder. Now that most toolkits have automatic layout (instead of pixel placement), it's easy.


Qt. It appears to be a well-designed toolkit with good widget selection. I'm pretty sure it does not use NativeWidgets.

Personally, I can't get past the licensing issue. My understanding is that any commercial or closed-source developer (on any platform) must purchase Qt for approximately $1000 US. Free open source software developers can use it for free.

If I spend a lot of time learning a package, and developing my own bag of tricks for it, and then want to release a $10 shareware program using it, I don't want to have to buy that license, or suddenly switch to a different package. I'm not saying it's wrong, just that I prefer to invest my time in a LGPL or BSD-ish library.

Richard Dale -- On the other hand, if you're happy with the GPL:

There are 'QtRuby' ruby bindings, and also a KDE superset called 'Korundum' - both are maintained as part of the KDE project. The Qt Designer UI builder is supported with a command line tool, rbuic, which converts designer .ui files to ruby code. They use Qt's signals/slots mechanism to wire up widgets to actions, which is high level and powerful. There is very complete coverage of the Qt/KDE apis, and you can do pretty much everything you can in C++.

A summary here: HTTP://developer.kde.org/language-bindings/ruby/

A start has been made with a rubyforge site here: HTTP://rubyforge.org/projects/korundum/

100% cross platform - Qt4/'QtRuby' bindings for Qt4 works on MacOSX? and Linux/Unix?, and should work on Windows as well.

Pragmatic Programmers have a book for 'QtRuby' - HTTP://www.pragmaticprogrammer.com/titles/ctrubyqt/

The bindings were first released as part of KDE 3.2 in early 2004.


WideStudio. Very portable toolkit, works on all desktops plus many embedded platforms. Supports C/C++,Ruby,Perl, and Python. There is a builder application supported which makes it great for RAD. THere are many widgets, and you can easily create your own widgets in the builder application. There are many options to choose from to make the experience enjoyable. The toolkit supports UTF8 very well, and has documentation in 6 different langauges.

Homepage: HTTP://www.widestudio.org

Books:

WideStudio (released 2004/11) HTTP://www.amazon.co.jp/exec/obidos/ASIN/4893622196/qid=1101299796/sr=1-3/ref=sr_1_10_3/250-1581975-5088264

WideStudio Powered by free development tools (released 2003/04) HTTP://www.amazon.co.jp/exec/obidos/ASIN/4839909644/qid=1101299796/sr=1-1/ref=sr_1_10_1/250-1581975-5088264

WideStudio ASCII SOFTWARE SCIENCE Language (released 2002/09) HTTP://www.amazon.co.jp/exec/obidos/ASIN/4756141412/qid=1101299796/sr=1-2/ref=sr_1_10_2/250-1581975-5088264


FLTK. It's extremely lightweight--perhaps over-simplified in some cases. For example, it only give you easy access to 256 colors. It has an adequate selection of widgets--more than some toolkits, fewer than others. The Ruby bindings are nice, and it seems very easy to learn. It runs natively on Win32 and X, but does not use NativeWidgets. A Mac version was in "beta" last time I checked.

My biggest concern is the general orientation towards pixel placement instead of layout managers. You can do layouts, but they seem like an afterthought. Version 2 (don't know when it might be ready) is supposed to have better layout support. The development community seems reasonably active. It may have the fewest widgets available, but the basics are there.

It has a GUI builder (named FLUID) for C++.

There are Ruby/FLTK bindings available.

Homepage: HTTP://fltk.org


For another summary of toolkits look at RubyTalk:100395 captured at this page: /TakeTwo.


See also:


HomePage | RecentChanges | Preferences | Wikis | RubyGarden
Edit text of this page | View other revisions
Rev 39, Last edited at January 27, 2006 16:08 pm by rgMrCode / 206.157.248.34 (diff)
Find: