I have no expirience with Perl or Tcl so variety of UI libs a bit
confuses me. What’s the point behind having several ones in paralel?
Which one is easier to start with, wich one gives more options? Where
can I find a working UI example?
RR
I have no expirience with Perl or Tcl so variety of UI libs a bit
confuses me. What’s the point behind having several ones in paralel?
Which one is easier to start with, wich one gives more options? Where
can I find a working UI example?
RR
Searching on the mailing list archive for ruby-talk will have lots of
discussion of the various GUIs as well as discussion of whether Ruby
should have its own GUI or should standardize on an existing GUI. I
think the question is a difficult one. Certainly, there is no need to
exclude any of the existing GUIs (having more than one doesn’t mean a
developer has to learn all of them). There has also been talk of
having an abstract Ruby GUI interface that uses whatever GUI is
available.
All of the below GUIs apparently work on Linux.
Tk – very portable (works on Linux, Windows and Mac OS X); included in
standard distribution of Ruby. I have worked on learning this because
I can get it to work on Mac OS X
Gtk – perhaps not fully implemented in Windows (from what I’ve heard);
I’ve not been able to get it to work on Mac OS X.
Fox – very portable and fast, but FXRuby (the Ruby API for Fox) is not
yet working with Ruby on Mac OS X. Fox is very popular with Ruby
programmers and is used in FreeRIDE, the new integrated development
environment program for Ruby. Fox is very object-oriented. I plan on
using Fox once I can get FXRuby working on Mac OS X.
Qt – used for Linux/KDE; the license is commercial for Windows use; I
don’t know if there is a Ruby API to this GUI toolkit.
Cocoa – RubyCocoa enables Ruby programs to work with Mac OS X
frameworks, although I haven’t yet tried it. I may use this, but
learning it is not my first priority because it is platform-specific.
Java – presumably one (or all) of the Ruby-Java libraries being
developed will be able to use the Swing GUI.
On Wednesday, December 25, 2002, at 05:36 PM, Roman Rytov wrote:
I have no expirience with Perl or Tcl so variety of UI libs a bit
confuses me. What’s the point behind having several ones in paralel?
Which one is easier to start with, wich one gives more options? Where
can I find a working UI example?RR
I have no expirience with Perl or Tcl so variety of UI libs a bit
confuses me. What’s the point behind having several ones in paralel?
I don’t think there is a point, except that many GUI toolkits exist for a
variety of reasons external to the Ruby world, and those of us programming
in Ruby would like to have GUIs… so luckily for those of us who are mere
mortals, others have written bindings of one sort or another to some of
the existing GUI toolkits. Which means we have a choice.
Which one is easier to start with, wich one gives more options? Where
can I find a working UI example?
I only know Gtk2, Fox, and Tk… and the best I can communicate are the
following vague impressions of the three (and I may express an opinion or
two, but none of them are very strong at this point).
Right now I’d say the easiest one to start with is Ruby-GNOME2 (and
specifically Gtk2)-- but I don’t base this on a lot of experience with it
yet (it is under active development after all). Joshua Keith has done an
excellent job (as yet unfinished, but the important stuff is there) of
translating the latest Gtk2 tutorial-- so getting introduced to how the
toolkit works is easy.
The Gtk2 documentation at http://www.gtk.org is fairly straightforward
(although written for C programmers, a Ruby programmer can learn a lot
from it). There is also some great Ruby API doc work getting done for
Gtk2. Find out more about Gtk2 at http://ruby-gnome2.sourceforge.net
Other reasons I like Ruby-GNOME2? As a GNU/Linux user using GNOME2 as my
desktop environment, I find the look and feel of my GUI fits in with my
other applications more readily (as Gtk is fully themeable). It has a
sensible geometry management system and a very easy to use callback system
(for tying window events to program actions).
I am using it to write all my new Ruby stuff that needs a GUI.
I am also working with Fox via FXRuby, simply because it exists-- and
because I am attempting to write on application to be completely toolkit
agnostic, meaning you can run the same program under whatever toolkit you
want. This is important to me because I need to have some applications
that will work on Windows-- and I don’t think Gtk2 will work with Ruby and
Windows for some time yet (someone please feel free to correct me if I’m
wrong). FXRuby and necessary prerequisites are included in the Ruby for
Windows distribution from the Pragmatic Programmers. AFAIK Fox is included
by default only in Debian GNU/Linux, you’d have to install it by hand for
most other Linux distros.
As I understand it the Fox GUI is not themeable (so you will get the basic
Win95-style appearance). Also, I find the API for this toolkit very
complex. And while Lyle Johnson is a great package maintainer and very
very helpful and working his tail off on our behalf, Fox is a very
minority GUI toolkit overall and doesn’t have the large non-Ruby community
around it that something like Gtk2 or Tk has. Find out more about FXRuby
at http://fxruby.sourceforge.net
I have used Tk a bit and find it is also very easy to use. There is some
great documentation for the raw Tcl version of the library at
http://www.tcl.tk and the Perl/Tk books from O’Reilly are pretty good. But
neither of these is Ruby focused, so you may get stuck on that. Tk is
included in your Ruby distribution (the Ruby binding is anyway, you still
have to find/install Tcl/Tk on your machine if you are on Linux, it is
included in the Ruby for Windows installers from the Pragmatic
Programmers).
Tk doesn’t have a lot of fancy, complex widgets included, so certain things
you’d have to program by hand. It’s also got its own capability for
styling, but there’s no such thing as a “theme” for Tk… you can control
color and font, but that’s really the limit.
All of these come with sample code of varying quality and their websites
are certainly helpful.
On Wednesday 25 December 2002 16:36, Roman Rytov wrote:
Thanks for your most informative post on the 3 GUIs.
Ot
On Thursday 26 December 2002 01:10 pm, Michael C. Libby wrote:
I only know Gtk2, Fox, and Tk… and the best I can communicate are the
following vague impressions of the three (and I may express an opinion or
two, but none of them are very strong at this point).Right now I’d say the easiest one to start with is Ruby-GNOME2 (and
specifically Gtk2)-- but I don’t base this on a lot of experience with it
yet (it is under active development after all). Joshua Keith has done an
excellent job (as yet unfinished, but the important stuff is there) of
translating the latest Gtk2 tutorial-- so getting introduced to how the
toolkit works is easy.