Tried it, and it seems like a bug. I don't see any reason that shouldn't work. 
Something to do with how the button block is implemented, perhaps, but that's a 
pretty weird bug.

Even if I assign the shoes.app object to a variable $app, and call $app.my_para 
inside the button block, you still see the method as undefined. So it's not 
like the block is changing "self" or something.. Sorry I'm no help.

- Ehsan

> Subject: Widget inside a function
> From: [email protected]
> Date: Sun, 26 Jul 2009 19:54:43 -0400
> To: [email protected]
> 
> Hi all.
> 
> Im wondering how to make this work:
> 
> 
> class MyPara < Widget
>       def initialize(txt)
>               para txt
>       end
> end
> 
> Shoes.app do
>       my_para '432'
>       button 'clickme' do
>               my_para '123'
>       end     
> end
> 
> Its failing for my_para '123'
> 
> 
> Thanks!

_________________________________________________________________
Bing™ brings you maps, menus, and reviews organized in one place. Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1

Reply via email to