Hello,

Could you point me what's wrong here?

The code:

class Cell1 < Shoes::Widget
  def initialize(opts={})
    @x = opts[:x]
    @y = opts[:y]
    @width = opts[:width]
    @height = opts[:height]
    paint
  end

  def paint
    fill(white)
    rect(@x, @y, @width, @height)
    line(@x, @y, @x + @width, @y)
    line(@x, @y, @x, @y + @height)
    line(@x + @width, @y, @x + @width, @y + @height)
    line(@x, @y + @height, @x + @width, @y + @height)
  end
end

class Cell2 < Shoes::Widget
  def initialize(x, y, width, height)
    @x = x
    @y = y
    @width = width
    @height = height
    paint
  end

  def paint
    fill(white)
    rect(@x, @y, @width, @height)
    line(@x, @y, @x + @width, @y)
    line(@x, @y, @x, @y + @height)
    line(@x + @width, @y, @x + @width, @y + @height)
    line(@x, @y + @height, @x + @width, @y + @height)
  end
end

Shoes.app do
  cell1(:x=>100, :y=>100, :width=>100, :height=>100) # doesn't work!!
  cell2(100, 100, 100, 100) # works ok
end


The paint methods are the same.
Is it a bug? Why it doesn't work while passing a hash? The console says nothing.

As usually any help will be blessed.

kind regards

sw

Reply via email to