Module: Glimmer::LibUI::Parent

Overview

Parent controls and shapes who have children and add child post_initialize_child

Instance Method Summary collapse

Instance Method Details

#childrenObject



31
32
33
# File 'lib/glimmer/libui/parent.rb', line 31

def children
  @children ||= []
end

#post_initialize_child(child, add_child: true) ⇒ Object

Subclasses can override and must call super (passing add_child: false to cancel adding child to children)



27
28
29
# File 'lib/glimmer/libui/parent.rb', line 27

def post_initialize_child(child, add_child: true)
  children << child if add_child
end