RSS
10 Nov 2007

Shoes, the Ruby Desktop GUI Toolkit

Author: ceefour | Filed under: Beginner, Cool, GUI, Ruby, Tools

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

If you simply want to write simple GUI desktop applications, Ruby with Shoes is a quick way to do it.

Example session in my computer:

Shoes01 Shoes, the Ruby Desktop GUI Toolkit

The code for that Timer GUI application is taken from the Shoes samples, which is concise enough for me to put it here:

Shoes.app :height => 150, :width => 250 do
  background rgb(240, 250, 208)
  stack :margin => 10 do
    button "Start" do
      @time = Time.now
      @label.replace "Stop watch started at #@time"
    end
    button "Stop" do
      @label.replace "Stopped, ", strong("#{Time.now - @time}"), " seconds elapsed."
    end
    @label = para "Press ", strong("start"), " to begin timing."
  end
end

To install Shoes on Ubuntu, it needs some dependencies which fortunately are very easy to install:

sudo aptitude install libungif4g libvlc0

More detailed download and installation instructions are available on whytheluckystiff’s site.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

blog comments powered by Disqus