In RubyTalk:100395 BillAtkins? wrote:
As anyone can tell by looking at the topics of my recent posts, I'm having trouble picking a Ruby GUI to use for a project. Here are some of the toolkits I'm considering and the pros and cons of each. My project, by the way, is a simple open-source, instant messaging client that would have to work on Windows and NIX systems. 1. Tk pros: comes with Ruby; pretty much everywhere; powerful TkText widget cons: messy, mostly undocumented API; unconventional appearance; requires tcl; no tree control; it's Tk :) 2. FOX pros: consistent and attractive appearance; very OO cons: no substitute for TkText - FXScintilla might do the trick, but it's API is a lot more complicated than TkText; somewhat C++-ish API; FxTreeList doesn't allow setting styles for individual items 3. Qt pros: supposed to be really nice cons: costs money on Win32 - out of the question 4. Gtk pros: plenty of widgets; antialiasing cons: supposed to be unstable on Win32; requires large download on Win32 machines; X-ish interface 5. Wx pros: well-designed Rubyish API; supports changing tree item styles; seems pretty stable for a young project; native widgets cons: brand new - could have problems; on Linux, requires a large download (wxGTK) in order to work (6MB) Wx would be my choice except that it requires such a large download on Linux. I would really prefer that the user download as little as possible, aside from Ruby itself. Considering that my project's source will be under 300K, it seems silly to require large GUI downloads just to make it work. Also, antialiased fonts would be extremely nice, but no toolkit seems to support them, except Gtk (right?) which I can't use because of the large Win32 dependencies. Any thoughts on these? Bill
Anonymous followed up with:
2. FOX Toolkit. One thing to watch out for with FOX is the licensing terms. If your project is GPL or LGPL already, then this is a non-issue. If your application links to it statically, you need to open source (LGPL) the entire application. If your application links to it dynamically, then well, read the LGPL (especially section 6 about giving others permission to modify your app). If you don't like these terms, try FLTK or wxWidgets which have permissive exceptions to the LGPL for statically linked applications that simply use the library. 5. wx (wxWidgets, wxRuby). I just tried wxWidgets 2.6.0 on Windows 2000. I used a program called DialogBlocks 1.94 (a GUI designer) to compile the example project to .exe. I chose the free MS VC++ Toolkit 2003 as the compiler. When I ran depends.exe on it to view the .dll list, it didn't include Gtk. All I saw listed were standard Windows libraries such as kernel32.dll, user32.dll, gdi32.dll, etc... No sign of Gtk-related libraries at all. I'm going to try wxRuby 0.6 next. So far, I've gone from FOX Toolkit -> FLTK -> ? with c++ and ruby. Looks like wxWidgets 2.6.0 is the next (and hopefully) last one I try. FLTK was/is nice but it probably won't have up-to-date ruby bindings in 1.1/1.2 branches due to lack of unicode or utf8 support. When FLTK 2.0 is released, I'm sure ruby support will improve since our friends in Japan will find it more useful than 1.x.
The above post by "Anonymous" was not in fact part of the original ruby-talk discussion thread back in May 2004. This is part of an unforunate attempt to spread FUD about FOX licensing terms. For the authoritative word on what FOX's license has to say about applications that are statically or dynamically linked to the FOX library, please see [this page] at the FOX Web site. -- LyleJohnson
PhilTomson followed up with:
FLTK? The FLTK shared lib and ruby bindings are smaller than 1MB. Problem is that it's still not released 'into the wild' (at least the source code for the bindings, that is). On Monday I'll try to remember to see if there has been any progress on that front.
JoaoPedrosa? followed up (the original) with:
> 4. Gtk > pros: plenty of widgets; antialiasing > cons: supposed to be unstable on Win32; requires > large download on > Win32 machines; X-ish interface "supposed to be unstable on Win32" Maybe. But I used to run my own Ruby-GNOME2 IRC client on Windows just fine. Once in a while you may find a bug (not really related to Windows), but if it's reproducible, it's fixable :) "requires large download on Win32 machines" That's the major drawback. I haven't tested something to shrink the package size yet. "X-ish interface" The Wimp engine does a good job at making your app have a native appearance. On the pro side: You can compile the latest version of Ruby-GTK+2 from the CVS on Windows by following the tutorial at HTTP://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_mingw. This way you can keep up with fixed bugs if you want. The project Ruby-GNOME2 has a more fine-grained control over its source-code, because it does not use SWIG. IMHO, it seems inevitable the progress of GTK+ on Windows.
AraHoward followed up (the original) with:
6. webrick + native browser
you're program spawns a webserver (fork or popen) and then spanws a browser
pointing at it. the webrick server IS the ui.
pros: works on *nix, windoze, mac. familiar ui. extremely quick to code.
cons: limiting ui (but what do you really need for an im client?)
just something to consider - i had managed to make this work in 30 lines of
code or so a while back - now i can't seem to find it, but it's pretty
straightword:
url = start_server
require 'rbconfig'
case platform
when /*nix/
start_nix_client url
when /windoze/
start_windoze_client url
when /mac/
start_mac_client url
end
See his full code at TheCrossPlatFormHTMLGUIScript
Vlad had this to say:
Are you trying the recently released RubyWebDialogs (graphical User Interface for Ruby Applications) ? HTTP://www.erikveen.dds.nl/rubywebdialogs/
That RubyWebDialogs certainly looks like an interesting project.
DavidRoss? followed up (the original) with:
7. WideStudio - APIs are same in every langauge it supports - Supports C/C++, Ruby, Perl, and Python - wsbuilder makes easy tool for RAD - good documentation of the API Homepage: HTTP://www.widestudio.org
Anonymous suggests adding ruby support for newer toolkits:
N1. Ultimate++: PROS: - New C++ GUI toolkit - Aims to enable more productivity than all existing toolkits - Very nice GUI Designer and debugger works in both Windows and Linux - BSD license! No fear of auto-granting patents & reverse-engineering rights to users if this is used in commercial products (unlike GPL and LGPL) - Actively being developed. Last release April 2005. CONS: - Current version is 0.98.5 (Released April 11, 2005) pre-1.0 scares people away - Smaller userbase since it is newer than others but growing (so is ruby) - Needs ruby bindings asap! - Documentation is hard-to-find because it only exists with their IDE as a custom tool! They really need to provide that info in webpages online... Homepage: upp.sourceforge.net/index.html