Module: Glimmer::LibUI::ControlProxy::Box

Included in:
HorizontalBoxProxy, VerticalBoxProxy
Defined in:
lib/glimmer/libui/control_proxy/box.rb,
lib/glimmer/libui/control_proxy/box/vertical_box_proxy.rb,
lib/glimmer/libui/control_proxy/box/horizontal_box_proxy.rb

Defined Under Namespace

Classes: HorizontalBoxProxy, VerticalBoxProxy

Constant Summary collapse

APPEND_PROPERTIES =
%w[stretchy]

Instance Method Summary collapse

Instance Method Details

#childrenObject



40
41
42
# File 'lib/glimmer/libui/control_proxy/box.rb', line 40

def children
  @children ||= []
end

#destroy_child(child) ⇒ Object



44
45
46
47
48
49
# File 'lib/glimmer/libui/control_proxy/box.rb', line 44

def destroy_child(child)
  child.deregister_all_custom_listeners
  ::LibUI.send("box_delete", @libui, children.index(child))
  ControlProxy.control_proxies.delete(child)
  children.delete(child)
end

#libui_api_keywordObject



36
37
38
# File 'lib/glimmer/libui/control_proxy/box.rb', line 36

def libui_api_keyword
  'box'
end

#post_initialize_child(child) ⇒ Object



30
31
32
33
34
# File 'lib/glimmer/libui/control_proxy/box.rb', line 30

def post_initialize_child(child)
  child.stretchy = true if child.stretchy.nil?
  ::LibUI.box_append(@libui, child.libui, Glimmer::LibUI.boolean_to_integer(child.stretchy))
  children << child
end