jes-ruby/runtime/lib/widget.rb
2014-07-27 09:28:35 -04:00

34 lines
410 B
Ruby

module Widget
def initialize
@x = 0
@y = 0
@width = 0
@height = 0
end
def children
[]
end
def resize(x, y, width, height)
@x = x
@y = y
@width = width
@height = height
end
def draw
if @x > 0 and @y > 0
render_begin
render
children.each do |child|
child.draw
end
render_end
end
end
def render_end
end
end