You know, I don't usually like to give useless replies like this, but here goes:
I can't believe I never thought of that. Seriously.
Anyway:
I think you can do this:
Shoes.app do
@para = stack { para "HI" }
@para.click { @para.clear { para Time.now.to_s } }
end
That should work. If it doesn't it's a bug.
On Mon, Jul 13, 2009 at 3:47 PM, Ehsanul Hoque<[email protected]> wrote:
> To detect a click inside a slot, I've been using the following type of
> pattern, which mostly works fine:
>
> stack do
> # Fill stack with stuff
> hover { click { para "I actually do something more useful than just a
> para" } }
> end
>
> But the click isn't detected if the slot is below the end of the app window
> and you have to scroll down to see it. If it's visible without scrolling,
> then the click is detected fine. A shoes bug I guess, both raisins and
> policeman. Test the bug with following code:
>
> Shoes.app do
> def create
> flow( :height => 100, :width => 1.0 ) do
> border black
> hover do |s|
> click { s.append { para "Clicked!" } }
> end
> end
> end
> 10.times { create }
> end
>
> First thought the hover isn't working, but replacing the above hover call
> with the following shows it's not the case:
> hover { |s| s.append { para "Hovered!" } }
>
> Any solutions/workarounds? I wouldn't mind another way to catch clicks
> inside a slot.
>
> - Ehsan
>
> ________________________________
> Windows Live™ Hotmail®: Spread the word when you add celeb photos to your
> e-mails. Check it out.
--
~devyn