Class: Glimmer::LibUI::GridProxy

Inherits:
ControlProxy show all
Defined in:
lib/glimmer/libui/grid_proxy.rb

Constant Summary collapse

APPEND_PROPERTIES =
%w[left top xspan yspan hexpand halign vexpand valign]

Constants inherited from ControlProxy

ControlProxy::BOOLEAN_PROPERTIES, ControlProxy::STRING_PROPERTIES

Instance Attribute Summary

Attributes inherited from ControlProxy

#args, #block, #keyword, #libui, #parent_proxy

Instance Method Summary collapse

Methods inherited from ControlProxy

#append_properties, #append_property, boolean_to_integer, #can_handle_listener?, #content, control_proxies, create, #default_destroy, #destroy, #destroy_child, #enabled, exists?, #handle_listener, image_proxies, #initialize, integer_to_boolean, #libui_api_keyword, main_window_proxy, menu_proxies, #method_missing, new_control, #post_add_content, #respond_to?, #respond_to_libui?, #send_to_libui, #visible, widget_proxy_class, #window_proxy

Constructor Details

This class inherits a constructor from Glimmer::LibUI::ControlProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer::LibUI::ControlProxy

Instance Method Details

#childrenObject



42
43
44
# File 'lib/glimmer/libui/grid_proxy.rb', line 42

def children
  @children ||= []
end

#post_initialize_child(child) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/glimmer/libui/grid_proxy.rb', line 29

def post_initialize_child(child)
  child.left = 0 if child.left.nil?
  child.top = 0 if child.top.nil?
  child.xspan = 1 if child.xspan.nil?
  child.yspan = 1 if child.yspan.nil?
  child.hexpand = false if child.hexpand.nil?
  child.halign = 0 if child.halign.nil?
  child.vexpand = false if child.vexpand.nil?
  child.valign = 0 if child.valign.nil?
  ::LibUI.grid_append(@libui, child.libui, child.left, child.top, child.xspan, child.yspan, ControlProxy.boolean_to_integer(child.hexpand), child.halign, ControlProxy.boolean_to_integer(child.vexpand), child.valign)
  children << child
end