hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Ruby-GNOME2 and Glade2 Demo #

by daigo in cult

Here is a ten-minute flash movie made by Mutoh-san to demonstrate implementation of Web browser using Ruby-GNOME2 and Glade2. Glade is a user interface builder for GTK+ and GNOME and generates an XML configuration file which can be converted to Ruby script by libglade.

What is your favorite GUI tool kit for Ruby on Linux (I am investigating)?

said on 28 Oct 2005 at 23:39

Yup, saw that a couple of days ago. It’s very impressive. I don’t code GUI apps, so I don’t have a suggestion.

said on 28 Oct 2005 at 23:42

Is it okay to be shocked that a web browser can be implemented in 10 minutes?

I mean, I know he didn’t do the rendering engine for the pages or anything (or DID he?, I didn’t finish watching yet), but still, it’s pretty impressive.

said on 28 Oct 2005 at 23:50

Okay, no rendering engine (that would be impressive in 10 minutes, VERY impressive, impossible, I think though, in 10 minutes, maybe an hour).

Still, I like what I see, and, if I may predict where you’re going with this: MouseHole Browser?

said on 29 Oct 2005 at 03:23

Yes, quite impressive!

At this time, we’re using QtRuby. But whenever I can, I’d like to try Korundum with KDE goodies.

Both of them are available at Rubyforge.

See ya!

said on 29 Oct 2005 at 04:04

I’m quite partial to the GTK toolkit, it even has gasp decent API documentation which at times borders on the excellent. Glade also takes the sting out of most of the UI design stuff.

I’d try the QT bindings, but I purged QT from my system 6 months ago and haven’t found a reason to reinstall it. Also, I’m not sure I want to be forced to licence my programs under the GPL (even tho I generally do…)

Now, if we just had a good console UI toolkit thingy I’d be happy…

Vag

said on 29 Oct 2005 at 04:56

I like gtk. The API feels nice, though it’s not very extensible if you want to step outside the box.

said on 29 Oct 2005 at 05:04

Extensible from the ruby side, I meant – I daresay it’s easy enough to extend in C

said on 29 Oct 2005 at 07:19

I did not know Glade and vnc2swf. They are great. I wondered which (Qt or Gtk) is mature for Ruby.

said on 29 Oct 2005 at 11:32

I haven’t tried any yet, but I feel like foxrb is nice enough for me to try out first.

said on 29 Oct 2005 at 11:33

or whatever it is called, fxRuby? fox gtk, in any case.

said on 30 Oct 2005 at 04:27

I’m not sure what you’re trying to say here: “Glade is a user interface builder for GTK + and GNOME and generates an XML configuration file which can be converted to Ruby script by libglade.”

But it sounds wrong ;)

said on 30 Oct 2005 at 06:20

Yeah, its wrong, the XML generated by Glade can be loaded into any application that has libglade bindings or libraries. It doesn’t generate any actual application code (well glade can generate C/C++ code but its depreciated and will be removed in glade 3 I think). Basicially you load the xml into your app, then you gain access to all the widgets defined in it.

I mainly like it because it allows me to skip defining every last widget in ruby, and its easier to change (most of the time) then hardcoded widgets.

Vag

said on 30 Oct 2005 at 07:01

I hope the focus of Ruby’s fan will move from macosx/fox-libs to gnome/gtk. gtk are: lgpl, multiplatform (nix,win,mac) and gnome is becaming better and better. There are already mature apps like Alexandria.

said on 30 Oct 2005 at 07:21

Porges, Vagabond: you’re both right, of course. However, what _why meant is that you can generate Ruby code from the Glade XML file. The Ruby-GNOME2 bindings come with a tool for just that: create the application skeleton that loads the XML file and prepares the callback methods.

said on 30 Oct 2005 at 12:27

I prefer Gtk since they seem to have a better api and because my desktop of choice is gnome. Btw, notice that you can create glade files even from other applications i.e. this gui builder written in python seem nice

said on 30 Oct 2005 at 23:01

I just started a project using Ruby-GTK, GNOME Web Studio. I was initially going to write it in C, but I’ve been able to get really far in only a few hours with Ruby. I’m looking forward to this toolkit maturing and being a standard install on all major distributions like PyGTK is today.

said on 30 Oct 2005 at 23:12

QtRuby is rather nice, the only real flaw I can pick with it is that it’s basically a Ruby wrapper around a C wrapper around a mostly-C++ API . :-)

said on 31 Oct 2005 at 05:19

Tsela: Ah, I was not aware that there was a glade code generator for Ruby. I think I prefer keeping it seperate anyway though, its easier to modify IMO .

Vag

said on 31 Oct 2005 at 09:19

I’m partial to GTK + as well. Can’t abide Glade though.

If you use it for code-generation, you lose the advantages of easy modification, as Vagabond points out.

If you don’t (i.e. libglade), you have to code around it and lose the opportunity to refactor your UI code. Gets all flat and mushy.

said on 31 Oct 2005 at 09:24

Vagabond: AFAIK , the code generator doesn’t translate the Glade XML file into Ruby. It just creates a Ruby file which loads the XML file and contains empty declarations for the call-back methods. So you still have full separation of interface and implementation. It just saves you the tedious job of writing the boiler-plate code yourself.

said on 31 Oct 2005 at 11:18

I’m partial to wxRuby. The wx library is stable and friendly. Partnered with ruby, its almost too good. It’s also x-platform and uses native widgets.

said on 01 Nov 2005 at 11:04

All about the Glade and GTK lovin’. The Ruby-Gnome2 team has pulled some really sweet moves that I can appreciate. Not only are they bindings to GTK , but they just feel…. rubyish.

said on 08 Nov 2005 at 23:15

I’d vote for wxRuby. :)

said on 08 Nov 2005 at 23:15

I’d vote for wxRuby. :)

said on 17 Nov 2005 at 00:53

wxRuby is fantastic! Give it a try! Only problem is getting it to install on Mac OS X (Tiger) with darwinports.

Comments are closed for this entry.