Michal Suchanek
2/13/2009 10:20:00 PM
2009/2/13 Ruby Student <ruby.student@gmail.com>:
> Hello all you happy GUIsher!
>
> Does anyone know of a good, well written book to learn one of the GUI
> supported by Ruby?
> I looked at:
>
> Fox
> TK
> QTK
> Jruby with netbeans
> shoes
> wxruby
> wide studio
> rubyonsteel
> monkeybars
>
> I want something simple or at least well documented. Preferable drag and
> drop. I would like to worry just about the ruby code and not necessarily
> about the creation of the widgets.
> Something close to what Visual Basic provides. I know this is wishful
> thinking. I would purchase the book or even purchase the GUI software (if it
> is reasonable). But all the tools I mentioned have their limitations and
> documentation is so so at best. I wish the tool to be cross-platform with
> native look and feel.
>
I have tried GTK recently .. and I was disappointed.
The wrapper for the library is pretty good AFAICT but it's still a C
widget library.
Many widgets are using an Adjustment for their data source (progress
bars, scroll bars, those range widgets, spinbuttons ..)
The Adjustment is sort of C range, and accepts only Floats as the
values. While it might be good enough for widgets with hidden values
and % progress bars it is not usable for widgets where you want to
show a value other than a simple number.
So to get date spinbutton, letter spinbutton, time range, etc. you
need to roll your own Range and your own widgets.
Actually the range widget seems to have some way of formatting the
text so you might get away with it for ranges that can be represented
as a float range and converted for display.
I guess this is unavoidable with C widgetry. Either the wrapper
implements flexible widgets that are incompatible with other languages
using the library or it uses the standard ones with limited C-friendly
functionality.
The other problem is with the GUI builder - Glade. While you can put
most (all?) simple widgets in place you can only create an outline for
a Treeview (this is how "list" and "table" is spelled in GTK). To put
together a working Treeview you have to do most of the work in your
code, the GUI builder cannot do that.
Still the GTK bindings are fine if you want something that works
reasonably in X and integrates well with the system. There is just
some mismatch between the language in which GTK is written and Ruby
unfortunately.
Thanks
Michal