Class: Glimmer::Tk::ButtonProxy

Inherits:
WidgetProxy show all
Defined in:
lib/glimmer/tk/button_proxy.rb

Overview

Proxy for Tk::Tile::Button

Follows the Proxy Design Pattern

Constant Summary

Constants inherited from WidgetProxy

WidgetProxy::DEFAULT_INITIALIZERS

Instance Attribute Summary

Attributes inherited from WidgetProxy

#args, #keyword, #parent_proxy, #tk

Instance Method Summary collapse

Methods inherited from WidgetProxy

#add_observer, #attribute_setter, #content, create, #get_attribute, #has_attribute?, #has_attributes_attribute?, #has_state?, #image_argument, #initialize, #method_missing, #post_add_content, #post_initialize_child, #respond_to?, #set_attribute, tk_widget_class_for, #tk_widget_has_attribute_getter_setter?, #tk_widget_has_attribute_setter?, #widget_attribute_listener_installers, #widget_custom_attribute_mapping, widget_exists?, widget_proxy_class

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

#command_block=(proc) ⇒ Object

TODO extract to a module



32
33
34
# File 'lib/glimmer/tk/button_proxy.rb', line 32

def command_block=(proc)
  tk.command(proc)
end

#handle_listener(listener_name, &listener) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/glimmer/tk/button_proxy.rb', line 36

def handle_listener(listener_name, &listener)
  case listener_name.to_s.downcase
  when 'command'
    command(listener)
  else
    super
  end
end