Class: Tgui::MessageBox::Button
- Inherits:
-
WidgetLike
- Object
- WidgetLike
- Tgui::MessageBox::Button
- Defined in:
- lib/white_gold/dsl/message_box.rb
Instance Attribute Summary
Attributes inherited from WidgetLike
Instance Method Summary collapse
-
#initialize(host, id) ⇒ Button
constructor
A new instance of Button.
- #on_press=(on_press) ⇒ Object
- #press_signal_execute ⇒ Object
Methods inherited from WidgetLike
abi_attr, abi_bit_enum, abi_def, abi_enum, #flags=, self_abi_def, self_abi_def_setter, self_abi_def_setter_with_id, self_abi_def_with_id, self_packers_id_extend
Methods included from BangDef
Methods included from BangNest
Methods included from BangNestedCaller
#bang_method_missing, #bang_object_stack, #bang_respond_to?, #self!, #upon!
Constructor Details
#initialize(host, id) ⇒ Button
Returns a new instance of Button.
30 31 32 33 |
# File 'lib/white_gold/dsl/message_box.rb', line 30 def initialize host, id super @on_press_callbacks = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BangNest
Instance Method Details
#on_press=(on_press) ⇒ Object
35 36 37 |
# File 'lib/white_gold/dsl/message_box.rb', line 35 def on_press=(on_press) @on_press_callbacks << on_press.to_proc end |
#press_signal_execute ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/white_gold/dsl/message_box.rb', line 39 def press_signal_execute host.page.upon! host do @on_press_callbacks.each do |c| c.(id, self, host) end end end |