GUI for a newbie

Hello All-

I have taken up Ruby over the past year and have finally written 7
applications for various functions for my job as a clinical pharmacist.

The problem I have here is that while my programs all work great, they
are all CLI interface. In order to increase their palatability among my
coworkers, however, I wish to add a GUI.

The question I have here is NOT which is the best for my needs. I have
it nailed down to three based on the platforms and screenshots I have
seen of their results:

Gtk (Would be nice on my Nokia n800 maemo)
Qt (My preference)
Tk (Seems to be the favorite of the Ruby folk)

My question is which would be the easiest to learn. While I want to use
Qt (I just feel comfortable with its maturity)I am concerned by how hard
it will be to learn, considering I have no C++ background.

Any guidance before I commit to learning one would be appreciated…

Thank you

Matthew F Borgeson

Matthew B. wrote:

Gtk (Would be nice on my Nokia n800 maemo)
Qt (My preference)
Tk (Seems to be the favorite of the Ruby folk)

My question is which would be the easiest to learn. While I want to use
Qt (I just feel comfortable with its maturity)I am concerned by how hard
it will be to learn, considering I have no C++ background.

Does it affect your decision that Nokia just bought the company that
makes Qt?

I’ve never developed anything with Qt, but it seems unlikely that you
need to know any C++ to use the ruby bindings.

Using GTK, you could build the gui with Glade

Alle Thursday 31 January 2008, Matthew B. ha scritto:

it nailed down to three based on the platforms and screenshots I have
Any guidance before I commit to learning one would be appreciated…

Thank you

Matthew F Borgeson

In my opinion Qt is easy to learn (although, I admit I used it in C++
before
using it in ruby). It’s true it’s written for C++, but most of it is
quite
clear and I believe that you can follow it even without knowing C++ (you
just
have to ignore everything which doesn’t concern ruby, for example
destructors,
memory management, virtual functions and so on). There’s also a
tutorial,
included with QtRuby, which is a porting of the original C++ tutorial
which I
think is well done. At

http://developer.kde.org/language-bindings/ruby/index.html

you’ll find a quick overview of the main differences between the ruby
and C++
versions.

Stefano

Alle Thursday 31 January 2008, Reid T. ha scritto:

Using GTK, you could build the gui with Glade

Qt include a designer, which does (I think) the same things glade does.

Stefano

Joel VanderWerf wrote:

Matthew B. wrote:

Gtk (Would be nice on my Nokia n800 maemo)
Qt (My preference)
Tk (Seems to be the favorite of the Ruby folk)

My question is which would be the easiest to learn. While I want to use
Qt (I just feel comfortable with its maturity)I am concerned by how hard
it will be to learn, considering I have no C++ background.

Does it affect your decision that Nokia just bought the company that
makes Qt?

I’ve never developed anything with Qt, but it seems unlikely that you
need to know any C++ to use the ruby bindings.

It doesn’t really affect my decision per se…

I personally develop using KDevelop on OpenSuse 10.3. The choice of
IDE(Glade, QtDesigner, Eclipse, et cetera)is irrelevant to me; likewise,
as KDE (using Qt) has been made to run on the n800, and gtk runs under
maemo on the n800 no problem, the purchase has little effect on my
decision; I really want just nice-looking, cross platform apps (thus my
decision for Qt) in the least amount of time possible…thus my choice
of the aforementioned three

I am really looking for ease of learning and time to proficiency.

give a look to Shoes, powered by _why (a top guy)

http://code.whytheluckystiff.net/shoes/

Matthew B. wrote:

it nailed down to three based on the platforms and screenshots I have
seen of their results:

Gtk (Would be nice on my Nokia n800 maemo)
Qt (My preference)
Tk (Seems to be the favorite of the Ruby folk)

My question is which would be the easiest to learn. While I want to use
Qt (I just feel comfortable with its maturity)I am concerned by how hard
it will be to learn, considering I have no C++ background.

Since nobody seems to have done it yet, let me place a +1 for Tk. I’m
not really into GUI programming much, but Tk has always felt very
straight-forward to me. And the new tk8.5 looks really nice (if you want
to judge a book by its cover). Most importantly, I think it is
significantly easier to learn Tk than Gtk or Qt.

I have played around a bit with both QtRuby and Ruby/Gtk and their both
okay, I guess. I’m not a huge fan of either. I must say that a slightly
prefer Ruby’s Gtk bindings to the Qt ones, although I prefer Qt itself
to Gtk.

If I were to build a GUI app for some inexplicable reason I would
start searching for bindings for Motif or the excellent Athena widget
set…

Lorenzo

On [Fri, 01.02.2008 10:03], Lorenzo E. Danielsson wrote:

The question I have here is NOT which is the best for my needs. I have

imo, Gtk is very straightforward to program/learn. Don’t know about Tk
though.

about tk, see:
http://arcadia.rubyforge.org/

“Arcadia is a Integrated Development Environment (IDE) for Ruby language
written in Ruby using the classic tcl/tk GUI toolkit.”

Despite some evidence and much opinion to the contrary, modern versions
of Tk actually produce a very good, platform-specific look and feel, if
used correctly. Tk also has an API that is very easy to work with.

For some good up-to-date info, see the tutorial at http://www.tkdocs.com

Mark

Am 1 Feb 2008 um 7:07 hat Matthew B. geschrieben:

I really want just nice-looking, cross platform apps (thus
my decision for Qt) in the least amount of time possible…thus my choice
of the aforementioned three

Qt is a good choice, but did you have a look at WxRuby?

Unlike Gtk or Tk, it is truly cross-platform with native look and feel,
because it uses the native tool kits of the platform, for example
Windows widgets on Win32, Aqua on OS X and GTK on Linux.

Have a look:
http://wxruby.rubyforge.org/wiki/wiki.pl?ScreenShots

It is just a gem away:
gem install wxruby

Dirk

On Feb 1, 2:20 pm, Jayson W. [email protected] wrote:

Tk (Seems to be the favorite of the Ruby folk)

for in a GUI Toolkit;
Tk was very easy for me to pick up. Where one GUI had me stumped, I
found that it took much less time to
figure out how to do the same thing in Tk. If your looking for ease of
learning, Tk is my choice. There are
others that have this or that, or can do this or that, but if your
looking for something quick, Tk is it.

–Jayson- Hide quoted text -

  • Show quoted text -

I had similar experiences a few years ago. Tk seemed to work “out of
the box” best. Kind of like how Python comes with Tk as a built-in GUI
builder with the standard install. While Qt has their designer and GTK
has Glade the last time I checked a true drag and drop GUI builder was
a lacking feature in Ruby. Even using the these GUI builders you had
to manually run some utilities and manually wire things together to
some extent.

Of course this was several years ago. I heavily rely upon Ruby for a
host of admin scripting, SQL data extraction/manipulation, and the
like. All CLI, though. The Ruby language is so relatively clean and
intuitive that it’s a lot easier to do things using it. But for RAD
design of GUI apps I eventually bit the bullet and went with C# using
Visual Studio 2005. I know there’s a lot of Microsoft haters among the
Ruby and Linux community but if there’s an quicker and easier way of
doing things I’d love to jump ship. I checked out everything from
Widestudio to all of the aforementioned GUI builders for Ruby. But
nothing compared to RAD development using VS2005. The last Ruby GUI
app I developed was back in 2005 using QtRuby and before that I
developed another one in 2003 using Ruby/Tk. Everything else since
then has been done using VS2005 and C#. The C# language is like tying
your hands behind your back compared to the elegance of Ruby but the
ease of dragging and dropping widgets and having the wiring together
done behind the scenes is worth it :frowning:

I’d love to get back into what current projects and revisions of GUI
builders are out there for Ruby though!

On Jan 31, 2008 3:56 PM, Matthew B. [email protected]
wrote:

it nailed down to three based on the platforms and screenshots I have
Any guidance before I commit to learning one would be appreciated…

Thank you

Matthew F Borgeson

Posted via http://www.ruby-forum.com/.

I cast my lot for Tk. I spent a great deal of time looking for a GUI
Toolkit to use with Ruby,
and I have dabbled with most all of them (shoes being the one
exception). Like yourself, I also found myself using
Ruby a lot at work, and wanted to make the interface for my
applications a bit more user friendly than a CLR interface.
After testing out one GUI or another, I always came back to Tk.
My reason for turning to Tk, was for the very things you are looking
for in a GUI Toolkit;
Tk was very easy for me to pick up. Where one GUI had me stumped, I
found that it took much less time to
figure out how to do the same thing in Tk. If your looking for ease of
learning, Tk is my choice. There are
others that have this or that, or can do this or that, but if your
looking for something quick, Tk is it.

–Jayson

On Feb 1, 2008, at 9:05 PM, gregarican wrote:

I have taken up Ruby over the past year and have finally written 7
have
Qt (I just feel comfortable with its maturity)I am concerned by

found that it took much less time to
I had similar experiences a few years ago. Tk seemed to work "out of
intuitive that it’s a lot easier to do things using it. But for RAD
ease of dragging and dropping widgets and having the wiring together
done behind the scenes is worth it :frowning:

I’d love to get back into what current projects and revisions of GUI
builders are out there for Ruby though!

A quicker easier way? Well, that’s a good question, initially, I
think of RubyCocoa, but of course it requires a little understanding
of the Cocoa/NextStep/OpenStep world… however, what I don’t know
and am very curious about now is whether or not there is a RubyCocoa
equivalent for GNUOpenStep (or is it GNUStep?) itself!!?
If so, that world has always been a pretty nifty RAD world, and if
RubyCocoa or something like it works with the open source version of
the IDE & GUI builder, then there would be some great tools to knock
things out quickly, and rebuild in C or Objective-C as needed for
performance.

Tk is definitely the easiest to get started with.
Qt is definitely one of the best looking and most native feeling with
the final product.
wx is somwhere in between.
Glade & GTK are not bad, but there’s a learning curve that will
require some time.

If you already have the CLI versions of the apps, and you are the one
who wrote them, it should be fairly easy to wrap them with GUIs, but
you might find yourself needing to change some of your code to make
sense with MVC design.

John J. wrote:

A quicker easier way? Well, that’s a good question, initially, I think
of RubyCocoa, but of course it requires a little understanding of the
Cocoa/NextStep/OpenStep world… however, what I don’t know and am very
curious about now is whether or not there is a RubyCocoa equivalent for
GNUOpenStep (or is it GNUStep?) itself!!?

  • gnustep-libs/rigs
    Latest version available: 0.2.2.20050714-r1
    Latest version installed: [ Not Installed ]
    Unstable version: 0.2.2.20050714-r1
    Use Flags (stable): -debug -doc
    Size of downloaded files: [no/bad digest]
    Homepage: GNUstep Developer Tools - RIGS
    Description: Ruby Interface for GNUstep.
    License: LGPL-2.1 GPL-2

John J. wrote:

  • gnustep-libs/rigs

practices. Microsoft is also, more obviously, hard to love…
I’m now looking forward to playing with gnustep on linux!

Well … before you canonize me too quickly, see

https://bugs.gentoo.org/show_bug.cgi?id=208643

:slight_smile:

I’ve been running WindowMaker as my main desktop for a couple of years
now, but I’ve never actually attempted to get the GNUStep stuff working.
I’ll never go back to KDE or Gnome – they’re just too bloated.

On Jan 31, 2008 3:56 PM, Matthew B. [email protected] wrote:

Everything else since then has been done using VS2005 and C#. The C# language is like tying
your hands behind your back compared to the elegance of Ruby but the
ease of dragging and dropping widgets and having the wiring together
done behind the scenes is worth it :frowning:

I’d love to get back into what current projects and revisions of GUI
builders are out there for Ruby though!

I would agree %100 with your comparison of C# and Ruby. Ruby almost
feels like it has a forgiving, intuitive soul, that understands what
you want it to do. C# on the other hand, feels more like a cold dead
thing, that will obey your command, if you ask nicely, but has no
intuition. Another option down the line for you may be Microsoft’s
IronRuby. I sort of cringe at the thought of IronRuby though. Its like
turning Ruby into a Borg,
…resistance is futile… you will assimilate!..
There is another tool by ActiveState called Tk Gui Builder (formally
called SpecTCL). It will create a Tk GUI for Ruby, Perl, and a few
other platforms, and has the RAD feel to it. Unfortunately it is no
longer supported, I recently gave GUI Builder a try, and although it
works well, it made some things more difficult. In the end, I found it
easier to write the code for the GUI myself. It might be worth you
having a look a though. There is also a small Google Group called
“Ruby And The Tk Toolkit”, that you might find useful.

If you are probably interested in GTK/Glade Ruby tutorials here are some
links.

http://www.micahcarrick.com/12-24-2007/gtk-glade-tutorial-part-1.html#Adding_Widgets_to_the_GtkWindow

Chapter 2: GUI Toolkits for Ruby (Ruby Developer’s Guide, Syngress Publishing).

Joel VanderWerf wrote:

Matthew B. wrote:

Gtk (Would be nice on my Nokia n800 maemo)
Qt (My preference)
Tk (Seems to be the favorite of the Ruby folk)

My question is which would be the easiest to learn. While I want to use
Qt (I just feel comfortable with its maturity)I am concerned by how hard
it will be to learn, considering I have no C++ background.

Does it affect your decision that Nokia just bought the company that
makes Qt?

I’ve never developed anything with Qt, but it seems unlikely that you
need to know any C++ to use the ruby bindings.

I just wanted to thand everyone with your two cents; it helped me make a
decision as follows:

While I appreciate the C# thoughts, I’ll pass as well as on any Visual
Studio or Microsoft tools. Besides the MS limiting of the free flow of
information, I really don’t want to spend any money on software; I don’t
mind buying books but I just feel buying software is a waste of money as
far as a hobby is concerned; At least I can take books with me on the
train, inthe bathroom, et cetera…

I downloaded the Agile Friday book on QtRuby (9 bucks) as well as the
tutorial from the Tk 8.5 website(Which actually does look better than
the versions before it)and have decided that I am going to try both on a
simple little 100-line, dose- calculating program I cobbled together and
see which is quicker to learn;Whichever one gives me the fewest
conceptual headaches wins :-).

The Gtk documentation seemed a bit convoluted and filled with exceptions
when I paged through it the first time. I looked at shoes, but it seemed
a bit cutting edge for me. WxRuby seemed a bit convoluted as well. The
tutorials for Tk and Qt are organized and seem to be what I need. I
guess Ill post here once I have finished the two programs and let
everyonoe know how it goes…

Thanks again for the feedback-

Matthew F Borgesono