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

Trivia

list_box needs to set :height explicitly

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

sample91.png

sample91.png

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
Shoes.app :width => 150, :height => 100 do
  @msg = para ''
  nostroke

  @img = image :width => 20, :height => 20, :left => 30, :top => 30 do
    oval :radius => 10, :fill => red
  end
  @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 '' }
end

sample92.png

sample92.png

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

http://shoes.yapok.org/

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.
http://github.com/why/shoes/wikis
The old one was retired. Now linked to the Shoes Official Homepage.
http://code.whytheluckystiff.net/shoes/
http://shoooes.net/

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.
http://github.com/why/shoes/wikis/buildingshoes

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.
http://newwws.shoooes.net/2008/09/22/the-rules-of-shoes.html

A very decent intro to shoes for beginners

http://ruby.about.com/od/shoes/Shoes.htm

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
Shoes.app :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!
EOS
  messages = messages.split("\n")

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

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

sample93.png

sample93.png

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

FIN.

Policeman

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.