Class: Shoes::Button
- Inherits:
-
Common::UIElement
- Object
- Common::UIElement
- Shoes::Button
- Includes:
- Common::Clickable, Common::Focus, Common::State
- Defined in:
- shoes-core/lib/shoes/button.rb
Constant Summary
Constants included from Common::State
Constants included from Common::Style
Common::Style::DEFAULT_STYLES, Common::Style::STYLE_GROUPS
Instance Attribute Summary
Attributes included from Common::Clickable
Attributes inherited from Common::UIElement
#app, #dimensions, #gui, #parent
Instance Method Summary collapse
Methods included from Common::State
#after_initialize, #enabled?, #state=, #update_from_state
Methods included from Common::Focus
Methods included from Common::Clickable
#click, #pass_coordinates?, #register_click, #release
Methods inherited from Common::UIElement
#add_to_parent, #after_initialize, #create_backend, #create_dimensions, #handle_block, #initialize, #needs_rotate?, #painted?, #redraw_height, #redraw_left, #redraw_top, #redraw_width, #update_fill, #update_stroke
Methods included from Common::Style
#applicable_app_styles, #create_style_hash, included, #style, #style_init
Methods included from Common::SafelyEvaluate
Methods included from Common::Remove
Methods included from Common::Positioning
Methods included from Common::Visibility
#hidden?, #hidden_from_view?, #hide, #outside_parent_view?, #show, #toggle, #visible?
Methods included from Common::Inspect
Methods included from Common::Attachable
Constructor Details
This class inherits a constructor from Shoes::Common::UIElement
Instance Method Details
#before_initialize(styles, text) ⇒ Object
15 16 17 |
# File 'shoes-core/lib/shoes/button.rb', line 15 def before_initialize(styles, text) styles[:text] = text || 'Button' end |
#text=(value) ⇒ Object
19 20 21 22 |
# File 'shoes-core/lib/shoes/button.rb', line 19 def text=(value) style(text: value.to_s) @gui.text = value.to_s end |