From: "Michael C. Libby" Date: 2002-12-26T11:10:11+09:00 Subject: [long] Re: Tc/GTC/Fox - so many? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 25 December 2002 16:36, 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? 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. - -michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+CmP84ClW9KMwqnMRAowiAJ92wBe7SesLSxRbTKeln16AZVHugwCgjllz Qvo2kvpkWJcoYqyfenhAXsw= =SDkm -----END PGP SIGNATURE-----