[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Ruby GUI with IDE
From:       David Vallner <david () vallner ! net>
Date:       2006-11-14 22:50:26
Message-ID: 455A4828.6030503 () vallner ! net
[Download RAW message or body]


Richard Conroy wrote:
> On 11/11/06, David Vallner <david@vallner.net> wrote:
>> AliasX Neo wrote:
>> > Windows users, what do you do to develop GUI's for Ruby?
>> >
>>
>> Handcode / use Python.
> 
> I am curious, but is handcoding Ruby UIs in whatever (Tk by default)
> a significant amount of work?
> 

I honestly haven't really tried. Gtk and Tk sort of put me off, since
the former seems to lack data binding, and the latter is just weird - I
could never get the layout right, and those pretty much the only stable
crossplatform GUI toolkits available.

> Consider doing the equivalent in Java Swing as a frame of reference?
> (painful but do-able).
> 

However, from having used the pre-rewrite wxRuby bindings, it was fairly
doable. Blocks-as-callbacks usually seem to hide most of the ugliness
you'd see futzing around with Gtk callbacks in C, and most of the
frameworks seem to follow roughly the same paradigm of nesting
horizontal and vertical layouts / splitters, as opposed to Swing's
layout managers. (Of which only the simple ones were meant for human
consumption anyway, the messier SpringLayout was to be generated by a
form designer since that's where a UI designer would more probably want
to use constraints between elements.)

> Basically, I like the idea of making simple UIs in Ruby for test tools,
> and software that you don't sell.
> 

Maybe Tk, since it's part of the stdlib, even if it has a weird approach
to scrolling, and personally I'd go with Wx if the rewrite gets Stable
Enough. On Windows, Gtk still looks disappointing, has to be installed,
and overall tries to pretend there's a Linux underneath - installing the
pre-rewrite Wx was a matter of dropping the wxruby.so into
C:\Ruby\lib\ruby\site_ruby\1.8\i386-msvcrt, which scores the people
major points in the Just Works category.

Also, most of Gtk example code is in C, and their object-oriented C API
is... byzantine to say the least, and I find it hard to mentally map
into Ruby. This is less of a problem for a C++ based framework. Since Tk
bindings almost always seem to involve writing Tcl with an alternate
syntax, there's another double-edged sword there. Code examples are
easily translated, but at least to me, they look out of place in Ruby.

Qt seems more designed to play nicely with the form designer. For larger
projects, that's a Good Thing - you can happily let a dedicated UI
designer take care of that and the programmers can concentrate on the
controlling code. The downside is that while it could be possible to
handcode it easily, at least I couldn't find much exhaustive online
material as to how.

David Vallner


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic