Class: Glimmer::LibUI::AreaProxy
- Inherits:
-
ControlProxy
- Object
- ControlProxy
- Glimmer::LibUI::AreaProxy
- Includes:
- FiddleConsumer
- Defined in:
- lib/glimmer/libui/area_proxy.rb
Overview
Proxy for LibUI area objects
Follows the Proxy Design Pattern
Constant Summary
Constants inherited from ControlProxy
ControlProxy::BOOLEAN_PROPERTIES, ControlProxy::STRING_PROPERTIES
Instance Attribute Summary collapse
-
#area_handler ⇒ Object
readonly
Returns the value of attribute area_handler.
Attributes inherited from ControlProxy
#args, #block, #keyword, #libui, #parent_proxy
Instance Method Summary collapse
- #can_handle_listener?(listener_name) ⇒ Boolean
- #children ⇒ Object
- #handle_listener(listener_name, &listener) ⇒ Object
- #on_draw(&block) ⇒ Object
- #post_add_content ⇒ Object
- #post_initialize_child(child) ⇒ Object
Methods included from FiddleConsumer
Methods inherited from ControlProxy
#append_properties, #append_property, boolean_to_integer, #content, control_proxies, create, #default_destroy, #destroy, #destroy_child, #enabled, exists?, image_proxies, #initialize, integer_to_boolean, #libui_api_keyword, main_window_proxy, menu_proxies, #method_missing, new_control, #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 Attribute Details
#area_handler ⇒ Object (readonly)
Returns the value of attribute area_handler.
33 34 35 |
# File 'lib/glimmer/libui/area_proxy.rb', line 33 def area_handler @area_handler end |
Instance Method Details
#can_handle_listener?(listener_name) ⇒ Boolean
59 60 61 |
# File 'lib/glimmer/libui/area_proxy.rb', line 59 def can_handle_listener?(listener_name) listener_name == 'on_draw' || super end |
#children ⇒ Object
45 46 47 |
# File 'lib/glimmer/libui/area_proxy.rb', line 45 def children @children ||= [] end |
#handle_listener(listener_name, &listener) ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/glimmer/libui/area_proxy.rb', line 63 def handle_listener(listener_name, &listener) case listener_name when 'on_draw' on_draw(&listener) else super end end |
#on_draw(&block) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/glimmer/libui/area_proxy.rb', line 49 def on_draw(&block) @on_draw_procs ||= [] if block.nil? @on_draw_procs else @on_draw_procs << block block end end |
#post_add_content ⇒ Object
40 41 42 43 |
# File 'lib/glimmer/libui/area_proxy.rb', line 40 def post_add_content super install_listeners end |
#post_initialize_child(child) ⇒ Object
35 36 37 38 |
# File 'lib/glimmer/libui/area_proxy.rb', line 35 def post_initialize_child(child) super children << child end |