Last modified on 25 October 2013, at 22:13

Ruby Programming/GUI Toolkit Modules

Ruby GUI toolkits are typically 3rd party GUI platforms that are driven (wrapped) by a Ruby driver.

Ruby bindings are available for several widget toolkits, among them Tk, Gtk, Fox, and Qt.

Here is a spreadsheet comparison.

See also "this list":http://stackoverflow.com/questions/260905/whats-the-best-easiest-gui-library-for-ruby and "this one":http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per

FXRubyEdit

FXRuby is a Ruby binding for the Fox GUI toolkit written in C++. It is available for installation using RubyGems.

AdvantagesEdit
DisadvantagesEdit
  • The book is over three years old.
  • Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7.
  • Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.
  • Even with binary gems it has non-Ruby dependencies that cannot be packaged with the code thus requiring end users to manually download, compile, and install dependencies.

FoxGUIbEdit

FoxGUIb is a visual GUI builder that can be used to create Fox UI's graphically instead of programmatically. It can be installed using the FoxGUIb Ruby gem.

AdvantagesEdit
  • Allows user to build a GUI screen quickly.
  • Subclasses event handling allowing decoupling between GUI elements and Ruby event code.
DisadvantagesEdit
  • Some GUI controls require a change in the order of placement when using Windows vs. Linux to be visually correct. e.g. You might have a popup frame that works in Linux but doesn't in windows. Moving the frame further up the control list allow the control to display properly.

qtRubyEdit

  • QtRuby gives you Ruby bindings to the Qt toolkit (the one used in the KDE desktop system).
Advantages:Edit
Disadvantages:Edit
  • While a gem is available for the Windows installation, only source code is available for other platforms.
  • qtbindings gem is available to windows and other platforms. It is derived from kdebindings.

ShoesEdit

"shoes":http://github.com/shoes/shoes was originally written by _why, and is now maintained by others. Its aim is to make ruby GUI development actually fun.

  • Advantages: cool graphics, control at a lower level, simple interface, can be used to distribute redistributables easily, used to have examples available.
  • Disadvantages: No gem (current gem, 3.0.1, is a place holder that does nothing), still a bit rough around the edges since it attempts to support so many platforms. Lacks many of the more robust widgets common in other toolkits,
Clipboard

To do:
Complete. One of the variants: green_shoes IS a gem that loads other gems

TkEdit

  • Advantages: Bindings are built-in to some ruby distros (most MRI ones).
  • Disadvantages:

More info:

  • Since Tk 8.5 it has had native look-and-feel for Windows, *nix and Mac.
  • Has Ruby-DSL for interface declaration.
  • When you install Ruby from source code, you need to be sure you also have the Tk dependencies and make sure the compilation settings include Tk.

Example project: "arcadia":http://github.com/angal/arcadia "more information":http://wiki.github.com/rdp/ruby_tutorials_core/tk "a tk designer":http://www.eggheadcafe.com/software/aspnet/35719090/ann-design-tool-jeszra-01-for-ruby-tk.aspx

wxRubyEdit

  • wxRuby is a binding for the cross-platform wxWidgets C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.
  • Advantages: cross platform, large support community (no longer true), windows support (including the new RubyInstaller!).
  • Disadvantages: Although appearing to be an abandoned project (ie. hasn't been updated since 2009), bug fixes have been loyally posted to the code base; tutorials do not match existing code base.

gnome rubyEdit

RubyCocoaEdit

  • Advantages: well integrated with MacRuby, good balance between power and ease of coding. Good support for testing.
  • Disadvantages: Mac OS X only

Winforms toolkitsEdit

Using the ironRuby interpreter you have the full .net platform, meaning you can code Winforms and WPF(I have only tried Winforms). It is potentially cross platform since the mono platform exists.

VisualurubyEdit

"Visualuruby":http://www.osk.3web.ne.jp/~nyasu/vruby/vrproject-e.html is a C/ruby based wrapper around the windows API windows, with quite a few examples, etc. Windows only, but nice native look.

Jruby toolkitsEdit

    • Note that you can use the "Rawr":http://rawr.rubyforge.org tool to cross-platform package any jruby application so that it includes all the code plus JRuby. The only real external dependency when using jruby+rawr is Java. Also working with jruby might integrate well with editing using NetBeans editor.

Swing wrappersEdit

  • Advantages: Swing is built in to the JRI. You can also create the UI using a traditional java visual developer, like NetBeans, then use it in Ruby.
  • Disadvantages: Some wrappers libraries are a little rough

raw swingEdit

You don't have to use any toolkit to use swing. Here's a "simple swing circle with dots":http://www.ruby-forum.com/topic/211827#920652

simple gui creatorEdit

This simplifies common tasks like asking for user input, dropdown forms, etc, and even has its own "Text based" layout engine, see "here":https://github.com/rdp/ruby_simple_gui_creator

MonkeybarsEdit

  • Advantages: JRuby, so cross platform, fully threaded; JRuby apps can be faster than MRI Ruby apps. can use rawr for bundling
  • Disadvantages:

input_formEdit

"input_form":http://github.com/rogergl/input_form has as its goal simplifying user interaction through forms, such as i18m, etc.

CheriEdit

Cheri is a jruby swing "builder framework":http://cheri.rubyforge.org which also includes some helper methods for java classes.

"Neurogami::SwingSet":http://neurogami.github.com/swingsetEdit

"Neurogami::SwingSet":http://neurogami.github.com/swingset

SWTEdit

This is the eclipse widget library, a competitor to Swing, in the Java world, and can be transparently used from JRuby. A project using it that is pretty complete is "http://redcareditor.com" Also see https://github.com/danlucraft/jruby-swt-cookbook

  • Advantages: Mature (used by Eclipse and supported), uses native widgets for the most part (like wxWidgets), cross platform. Extensive Java documentation around the toolkit.
  • Disadvantages: Jars must be bundled for cross platform deployment.

limelightEdit

"limelight":http://limelight.8thlight.com/main/sparkle aims to make GUI development simple.

  • Disadvantages:
    • As of 2011.03.26 Limelight doesn't work with JRuby 1.6 on OS X 10.6 or 10.7. There is a problem ticket in but it hasn't been looked in almost a year.
    • Virtually non-existent documentation.

profligacEdit

"profligacy":http://ihate.rubyforge.org/profligacy/ attempts to make creating jruby GUI's quite trivial.

looks nice, though appears quite unmaintained.

swibyEdit

"swiby":http://swiby.codehaus.org/

looks a bit unstable

glimmerEdit

"glimmer":http://www.infoq.com/news/2008/02/glimmer-jruby-swt a wrapper for eclipse's swt

HTML related toolkitsEdit

BowlineEdit

"bowline":http://leadthinking.com/191-bowline-a-ruby-gui-framework

appceleratorEdit

"appcelerator":http://www.codestrong.com/titanium/guides/get_started/chapter_1/ (has ability to use ruby inline) "description":http://www.ruby-forum.com/topic/202402#881486

anvilEdit

"anvil":http://www.rubyinside.com/interesting-ruby-tidbits-that-dont-need-separate-posts-13-689.html

looks kind of dead, but aimed to have GUI-like rails programming.

GestaltEdit

"gestalt":http://www.rubyflow.com/items/3000 allows you to run ruby in the browser instead of javascript (interface into silverlight apps). it also uses "silverlight":http://www.rubyinside.com/ironruby-silverlight-ruby-in-browser-3192.html