Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
155 lines (102 sloc) 3.81 KB


list_box needs to set :height explicitly

# sample91.rb :width => 300, :height => 60 do
  button('OK'){@msg.text = @e.text}
  @e = list_box :items => ['blue', 'red', 'yellow'], :height => 30
  @msg = para ''



Try to comment out :height => 30 and run.
The list_box doesn't show the items.
This strange behavior occurs only on Windows. On Mac OS X, it doesn't.

This OS X information was provided by George Thompson.

strange mouse event behavior

# sample92.rb :width => 150, :height => 100 do
  @msg = para ''

  @img = image :width => 20, :height => 20, :left => 30, :top => 30 do
    oval :radius => 10, :fill => red
  @img.hover{ @msg.replace 'hello' }
  @img.leave{ @msg.replace '' }

  @o = oval :left => 60, :top => 60, :radius => 10, :fill => blue
  @o.hover{ @msg.replace 'hi' }
  @o.leave{ @msg.replace '' }



The image (red) oval works the mouse hovering feature but the blue doesn't.
This behavior is a bug. But it is fixed in the latest Shoes-0.r970 and later.

Shoes Fest

Shoes was born July 31st, 2007.

Yes, July 31st is Shoes' birthday and it is now one year old.

Shoes wiki

A new Shoes wiki was launched on Sep 12th, 2008.
The old one was retired. Now linked to the Shoes Official Homepage.

Built-in sample apps

See the following directory (in Windows XP with Shoes-0.r1057)
There are many sample code. Let's hack!

C:\Program Files\Common Files\Shoes\0.r1057\samples

Building Shoes

If you have to build Shoes by yourself, this information might be useful.

The Rules Of Shoes and UTF-8 Everywhere

Shoes scope can be a bit confusing...
Shoes supports UTF-8 everywhere. Can't wait to get the next build.

A very decent intro to shoes for beginners

Lovely creatures

Lovely creatures in this tutorial were created by Anita Kuno.
Each creature has his/her own name.
purple is loogink
green is Cy
brown is Yar
blue is kamome
white is shaha

# sample93.rb :width => 400, :height => 75, :title => 'Lovely Creaturs' do
  background "#D0A".."#F90", :angle => 90
  x = 0
  creatures = %w(loogink yar cy kamome shaha).collect{|c| image "../images/#{c}.png", :left => x += 60}

  messages =<<-EOS
Thx for reading. :)
See you!
Enjoy Ruby and Shoes!
  messages = messages.split("\n")

  msg = subtitle '', :top => 30, :stroke => white
  animate(3) do
    creatures.each{|c| c.move c.left, rand(15)}

  creatures.each do |c|
    c.hover{msg.text = strong messages[rand(messages.length)]}
    c.leave{msg.text = ''}



Let's enjoy Ruby and Shoes with the Lovely Creatures!



The sample91.rb and sample92.rb worked with Shoes-0.r1263 as same as Raisins.

Replace String#to_a to String#split for Ruby 1.9. Then the sample93.rb also worked well.

Jump to Line
Something went wrong with that request. Please try again.