Hi!
I am trying to make a game in Shoes, and so I am making classes that are
custom widgets. I've got something that can draw itself, but handling events
is still eluding me.

Here's something like what I would like to do:

class Thing < Widget
  def initialize
    self.width=300
    self.height=300
    background blue
  end
end

Shoes.app do
  thing do
    hover { background red }
    leave { background blue }
    click { alert "Ha!" }
  end
end

Of course, it doesn't work at all (except the painting part). If I replace
"thing" with a stack, then it seems to work, so what magic is stack doing
that other widgets don't?

Reply via email to