On Sat, Nov 22, 2008 at 1:01 AM, Michael Saelee <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I just started working through examples in the Shoes manual, and am trying:
>
> Shoes.app do
> stack :width => 200, :height => 200 do
> background red
> hover { clear { background blue } }
> leave { clear { background red } }
> end
> end
>
> As I understand it, the (initially red) stack should turn its background
> blue on mouse entry, then turn red again when the cursor leaves. When I
> test it, however, the entire app window turns blue on entry, and I can't get
> it to turn red again. Am I doing something wrong, not getting how it's
> supposed to work, or is this a bug?
>
> I'm running Shoes 0.r1091 on a PowerPC (OS X 10.5.5).
Yeah. The context of the hover/leave blocks is not the slot they are
attached to. The hover event paints a new background over the top
level app slot. This covers your stack so that you never see the leave
event happen.
Something like this should do:
Shoes.app do
@stack = stack :width => 200, :height => 200 do
background red
hover { @stack.clear { background blue } }
leave { @stack.clear { background red } }
end
end
--
Seth Thomas Rasmussen
http://greatseth.com