Wednesday, October 28, 2009

Recipe 21.1.










Recipe 21.1.



Resources


HighLine, written by James Edward Gray II and Gregory Brown, is available as the highline gem. The
Curses and
Readline libraries come preinstalled with Ruby (even on Windows, if you use the one-click installer). If you're using Windows and don't have
Curses, you can get the library and the Ruby bindings from http://www.dave.burt.id.au/ruby/curses.zip.


Ncurses is an improved version of Curses (allowing things like colored text), and most modern Unix systems have it installed. You can get Ncurses bindings for Ruby from http://ncurses-ruby.berlios.de/. It's also available as the Debian package libncurses-ruby.


The Tk binding for Ruby comes preinstalled with Ruby, assuming you've installed Tk itself. Ruby bindings for the most common GUI toolkits have been written:


  • GTK (http://ruby-gnome2.sourceforge.jp/)

  • QT (http://sfns.u-shizuoka-ken.ac.jp/geneng/horie_hp/ruby/index.html)

  • wxRuby (http://wxruby.rubyforge.org/)


wxRuby is interesting because it's cross-platform and uses native widgets on each platform. You can write a Ruby program with wxRuby that runs on Unix, Windows, and Mac OS X, and looks like a native application on all three platforms.


On Mac OS X, all the tools you need to build a Ruby GUI application come with the operating system, including a GUI builder. If you're using GTK, your life will be easier if you download the Glade GUI builder (http://glade.gnome.org/).













No comments:

Post a Comment