Class: Glimmer::Tk::EntryProxy
- Inherits:
-
WidgetProxy
- Object
- WidgetProxy
- Glimmer::Tk::EntryProxy
- Includes:
- TextVariableOwner
- Defined in:
- lib/glimmer/tk/entry_proxy.rb
Overview
Proxy for Tk::Tile::TEntry
Follows the Proxy Design Pattern
Constant Summary
Constants inherited from WidgetProxy
Instance Attribute Summary
Attributes inherited from WidgetProxy
#args, #bind_ids, #children, #destroyed, #keyword, #parent_proxy, #tk
Attributes included from DraggableAndDroppable
Instance Method Summary collapse
- #handle_listener(listener_name, &listener) ⇒ Object
- #invalidcommand_block=(proc) ⇒ Object
- #validatecommand_block=(proc) ⇒ Object
Methods included from TextVariableOwner
Methods inherited from WidgetProxy
#add_observer, #ancestor_proxies, #apply_style, #attribute_setter, #content, create, #destroy, #font=, #get_attribute, #grid, #has_attribute?, #has_attributes_attribute?, #has_state?, #image_argument, #initialize, #inspect, #method_missing, #on, #post_add_content, #post_initialize_child, #respond_to?, #root_parent_proxy, #set_attribute, #style=, tk_widget_class_for, #tk_widget_has_attribute_getter_setter?, #tk_widget_has_attribute_setter?, #toplevel_parent_proxy, #unbind_all, #widget_attribute_listener_installers, #widget_custom_attribute_mapping, widget_exists?, widget_proxy_class
Methods included from DraggableAndDroppable
#drag_source=, #drop_target=, #make_draggable, #make_droppable, #make_non_draggable, #make_non_droppable, #on_drag_start_block=, #on_drop_block=, #textvariable_defined?
Constructor Details
This class inherits a constructor from Glimmer::Tk::WidgetProxy
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Glimmer::Tk::WidgetProxy
Instance Method Details
#handle_listener(listener_name, &listener) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/glimmer/tk/entry_proxy.rb', line 41 def handle_listener(listener_name, &listener) case listener_name.to_s.downcase when 'change', 'changed', 'modified' tk.textvariable.trace('write') { listener.call(@tk.textvariable) } when 'validatecommand', 'validate' self.validatecommand_block = listener when 'invalidcommand', 'invalid' self.invalidcommand_block = listener else super end end |
#invalidcommand_block=(proc) ⇒ Object
37 38 39 |
# File 'lib/glimmer/tk/entry_proxy.rb', line 37 def invalidcommand_block=(proc) tk.invalidcommand(proc) end |
#validatecommand_block=(proc) ⇒ Object
33 34 35 |
# File 'lib/glimmer/tk/entry_proxy.rb', line 33 def validatecommand_block=(proc) tk.validatecommand(proc) end |