Class: Glimmer::LibUI::ControlProxy::GridProxy

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

Constant Summary collapse

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

Constants inherited from Glimmer::LibUI::ControlProxy

BOOLEAN_PROPERTIES, KEYWORD_ALIASES, STRING_PROPERTIES, TransformProxy

Instance Attribute Summary

Attributes inherited from Glimmer::LibUI::ControlProxy

#args, #block, #content_added, #custom_control, #keyword, #libui, #options, #parent_custom_control, #parent_proxy, #slot

Instance Method Summary collapse

Methods inherited from Glimmer::LibUI::ControlProxy

#append_properties, #append_property, #bind_content, #can_handle_listener?, constant_symbol, #content, control_proxies, control_proxy_class, create, #custom_listener_name_aliases, #custom_listener_names, #default_destroy, #deregister_all_custom_listeners, #deregister_custom_listeners, descendant_keyword_constant_map, #destroy, #destroy_child, #enabled, exists?, #handle_custom_listener, #handle_listener, #has_custom_listener?, image_proxies, #initialize, keyword, #libui_api_keyword, #listeners, #listeners_for, main_window_proxy, map_descendant_keyword_constants_for, menu_proxies, #method_missing, new_control, #notify_custom_listeners, #post_add_content, reset_descendant_keyword_constant_map, #respond_to?, #respond_to_libui?, #send_to_libui, #visible, #window_proxy

Methods included from DataBindable

#data_bind, #data_bind_read, #data_bind_write, #data_binding_model_attribute_observer_registrations

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



54
55
56
# File 'lib/glimmer/libui/control_proxy/grid_proxy.rb', line 54

def children
  @children ||= []
end

#post_initialize_child(child) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/glimmer/libui/control_proxy/grid_proxy.rb', line 30

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,
    Glimmer::LibUI.boolean_to_integer(child.hexpand),
    Glimmer::LibUI.enum_symbol_to_value(:align, child.halign),
    Glimmer::LibUI.boolean_to_integer(child.vexpand),
    Glimmer::LibUI.enum_symbol_to_value(:align, child.valign)
  )
  children << child
end