Home   Archive   Permalink

The little things

One of my students has been studying Ruby. Today, I put together some materials about Ruby GUI libraries for him (QT, GTK+, wx, Fox, Shoes, etc.). QT is my favorite, but there's a nice builder application for GTK+ at http://visualruby.net . Visual Ruby "enormously simplifies the process of adding GTK+ windows to your applications". On the Visual Ruby home page, the creation of a "Coin Flip" application is demonstrated in 10 minutes. Based on that video, I made this comparable R2 example:
R E B O L []
h: load http://re-bol.com/heads.jpg
t: load http://re-bol.com/tails.jpg
random/seed now
view g: layout [
     i: image h
     f: field
     btn "Flip" [
         f/text: first random ["Heads" "Tails"]
         either f/text = "Heads" [i/image: h] [i/image: t] show g
I often wonder if, for simple tasks, there could possibly be a more concise approach to language design than Rebol's dialects.

posted by:   Nick       28-Nov-2013/6:55:29-8:00

BTW, Ruby 1.9.3 is 15+ megabytes, Glade is 17+ megabytes (+ you need the gtk2 gem). That's still exceedingly lite compared to the minimum *241* megabyte download package (+ qtbindings gem) required to install QT.
It took a good portion of a lesson just to install the tools to demonstrate to my student.
Rebol is a few hundred kilobytes, took a few seconds to download and install, and a few minutes to write the code from scratch.

posted by:   Nick       28-Nov-2013/7:09:24-8:00

I made a quick video: http://youtu.be/0zckFPgQ2Co

posted by:   Nick       28-Nov-2013/13:41:25-8:00

Wonder no more -- the answer is NO !
I looked at your GUI list for your student and immediately said -- been there done that !!
I've done the 'whats the best/easiest gui tool' search over many years -- and REBOL is by far the easiest to setup and use!
I'd have to go back to Paradox for Windows with its built in GUI IDE to come even close to REBOL for rapid end-user GUI development.
Your student might be interested to know that I settled on FXRUBY ( FOX ) as it has the least overhead,
program & understanding wise, and its usage is well explained, and it is very well designed and offers really nice results.
However FXRUBY is not being supported now since Lyle Johnson's retirement, but that is probably not problem as it was quite mature at the time.
The book 'Ruby Developers Guide' by Feldt/Johnson/Neumann ( Syngress Press ) compares a couple of GUI's using real code examples.
Having said that, you can't get away from the massive coding overhead that all GUI Libraries impose upon the coder! After I wrote my first test
FXRUBY program I decided to write a code generator to save me the effort it was well worth doing as I could knock up useful GUI interfaces
in few minutes knowing the GUI code itself would be syntactically complete, ie: no missing parameter separators.
More recently I pondered over which GUI tool I would use for a small Ada project, and after viewing GTK+ verse a HTML/Browser solution it was obvious
that the GTK+ was just too much effort. GTK+ offered a better range of effects, etc , but , no thanks! , used Ada + AWS ( Ada Web Server ), works well
but still far far more complex than REBOL.

posted by:   dragoncity       29-Nov-2013/18:10:53-8:00

It's good to know more about FXRUBY. Of all the Ruby choices, it's the toolkit with which I'm least familiar. I pointed out the book, and a few examples online, but focused on others for which I'd actually some written code examples. I'll pass along your recommendation.
Shoes is an interesting learning tool for beginners. I never got deep into it, but the basics are reminiscent of VID, and it's great for introducing first steps in GUI building, if students already know some Ruby. It's too bad it never became more mature...

posted by:   Nick       29-Nov-2013/20:30:20-8:00

Ruby is littered with various project attempts to create a end-user GUI tool,
but all have pretty much failed. A very early one written in Ruby ( don't remember its name )
was looking promising, *but* it was so slow to be totally useless.
One nice coding feature of FXRuby is how Lyle kept the same interface style of the original FOX ( C++)
so you can get lots of useful info from the original FOX documentation if necessary.
Your student might find this small article I wrote explaining the basic concepts of creating a small FXRuby form.
(note: the email contact address is invalid now :-)

posted by:   dragoncity       29-Nov-2013/23:54:27-8:00

Thanks for the doc!
Is there somewhere else to get the FXRuby binaries, now that rubyforge is offline (they were apparenly hacked, and it's been days)?

posted by:   Nick       30-Nov-2013/7:52:30-8:00

Never mind - found it on rubygems.org (and will try to compile from source from github)

posted by:   Nick       30-Nov-2013/7:57:48-8:00

Your tutorial is great! (just having problems getting the FXrbuy gem to work in 1.9.3...)

posted by:   Nick       30-Nov-2013/8:31:30-8:00

Found the problem - the newest configuration needs 'require fox16"

posted by:   Nick       30-Nov-2013/8:38:34-8:00

I appreciate your input on this - FXRuby looks to be well maintained, nicely designed, lite, and simple to use. I'll focus on it this week!

posted by:   Nick       30-Nov-2013/8:40:47-8:00

Glad you found my little tutorial useful, I have not done any Ruby programming for a while, but out of general interest I browsed around and
found this copy of Lyle's definitive book on using FXRuby. Maybe you have already seen it ?

posted by:   dragoncity       1-Dec-2013/5:04:01-8:00

Already well into it :)

posted by:   Nick       1-Dec-2013/18:23:25-8:00

Hi Nick, was wondering if you & your student had made any headway/thoughts with Ruby/FXRuby ?
BTW: The reverse captcha was really difficult !
ie "w" :-)

posted by:   dragoncity       6-Dec-2013/21:19:50-8:00

He's going off into some Java classes at college soon, so I've switched gears - looking into Codename One for cross platform mobile development with Java (and checking up on Kivy too, just to see what's changed for mobile Python GUI).

posted by:   Nick       7-Dec-2013/2:54:35-8:00

Also, playing with Haxe and OpenFL again, looking to see if there are any new developments.
For now, my needs are taken care of by a combination of R2 and R3, and I'm really getting excited about how quickly Red is progressing!

posted by:   Nick       7-Dec-2013/9:28:14-8:00

I'll keep FXRuby in my back pocket. It's a nice tool and the book is a big advantage. I appreciate your input - probably wouldn't have looked at it much otherwise. For me QT is gonna have to get more attention in the near future, because it's improving in the Android area, it's popularly accepted, has many language bindings, covers things other than GUI, looks great, etc. It's huge, but for "non-Rebol" situations, it ticks lots of boxes (honestly, in my case, non-Rebol situations really don't really come up these days, but who knows...).

posted by:   Nick       7-Dec-2013/9:57:12-8:00

I looked a Haxe last month, and was disappointed as it kept falling over with 'segmentation faults', so I was not impressed. ( Under Linux).
Looked like a fairy clean language to work with.

posted by:   dragoncity       7-Dec-2013/19:18:13-8:00

I haven't used Haxe on Linux, but I'm surprised to hear that. Were your examples just run of the mill stuff, or unusual edge cases?

posted by:   Nick       8-Dec-2013/0:12:09-8:00

I find that Haxe drops out with a segmentation fault if anything in the CLI was not 100%,
ie: wrong parameter or filename error, extra character, etc.
Just felt that the user-interface is a little 'under cooked' and not much checking is done :-)
Haxe 3.0.0 installed from siduction ( Debian SID) Linux install package,
there many be later versions out there.
Have not done anything interesting with Haxe.

posted by:   dragoncity       9-Dec-2013/1:49:57-8:00