Class: UnderOS::UI::Button
- Inherits:
-
View
- Object
- View
- UnderOS::UI::Button
- Defined in:
- lib/under_os/ui/button.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Button
constructor
A new instance of Button.
- #text ⇒ Object
- #text=(new_text, state = UIControlStateNormal) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Button
Returns a new instance of Button.
4 5 6 7 8 9 10 11 |
# File 'lib/under_os/ui/button.rb', line 4 def initialize(={}) super self.text = .delete(:text) || '' @_.showsTouchWhenHighlighted = true @_.setBackgroundImage(.delete(:image), forState:UIControlStateNormal) if [:image] @_.sizeToFit end |
Instance Method Details
#text ⇒ Object
13 14 15 |
# File 'lib/under_os/ui/button.rb', line 13 def text @_.currentTitle end |
#text=(new_text, state = UIControlStateNormal) ⇒ Object
17 18 19 20 |
# File 'lib/under_os/ui/button.rb', line 17 def text=(new_text, state=UIControlStateNormal) @_.setTitle new_text, forState:state repaint end |