Hi Emanuel,
I'm not sure that I understand your problem correctly, though...
The following code works well as I've expected.
I'm useing Windows XP with Shoes-0.r1091.
It also works well with Shoes-0.r1057.
class Shoes::Widgy < Shoes::Widget
def initialize opts = {}
size = opts[:size] || 50
fill opts[:color] || yellow
rect 0, 0, size, size
end
end
Shoes.app :width => 300, :height => 300 do
w1 = widgy :left => 50, :top => 50, :color => red
w2 = widgy :left => 50, :top => 50, :color => blue, :size => 100
w2.move 100, 100
w3 = widgy
w3.left = 200
w3.top = 200
end
I think that we can use :left and :top without definition in class Widgy.
Because inherited from Shoes::Widget.
Hope it helps,
ashbb
On Wed, Nov 19, 2008 at 10:59 AM, Emanuel Carnevale <
[EMAIL PROTECTED]> wrote:
> Hi, I know Widgets are not the most cared things in shoes, but I stumbled
> in this thing:
>
> class Shoes::Widgy < Shoes::Widget
> attr_accessor :size
>
> def initialize opts = {}
> @size = opts[:size] || 100
> fill "#000"
> rect 0, 0, @size, @size
> end
> end
>
> I have to call it with
>
> w = widgy :top => 20, :left => 30
>
> if I do w.move(30,30) it moves, so I start expecting it behaves like every
> other elements.
> but why I cannot do
>
> w.left or w.right ?
> obviously w.size works
>
> it's a bug or I'm missing something?
>