Hi,

I tried the example at
http://hackety.org/2007/08/02/mashingInSomeGraphics.html, but couldn't get
it to work.

I modified it a bit, and I get the rectangles, but when I click OK, the
window is just blank, it doesn't recreate the rectangles and button. Here's
my code:

rectangles = proc do
  20.times do
    nostroke
    fill rgb(rand(0.6) + 0.4, rand(0.1) + 0.9, rand(0.2) + 0.8, rand(0.4) +
0.1)
    r = rand(300) + 60 # radius
    rect rand(100), rand(200), r, r
  end
  button "OK", :x => 300, :y => 400 do
    # clear wipes out the window and uses the passed block to repaint
    # it again.
    clear &rectangles
  end
end

Shoes.app :width => 400, :height => 500, &rectangles

Any ideas?

Thanks!

-- Jo

Reply via email to