Method: MiniGL::Panel#add_component

Defined in:
lib/minigl/forms.rb

#add_component(c) ⇒ Object

Adds a component to this panel. Parameters:

c

The component to add.



175
176
177
178
179
# File 'lib/minigl/forms.rb', line 175

def add_component(c)
  _, x, y = FormUtils.check_anchor(c.anchor, c.anchor_offset_x, c.anchor_offset_y, c.w, c.h, @w, @h)
  c.set_position(@x + x, @y + y)
  @controls << c
end