Class: Nuklear::UI::Option
- Defined in:
- lib/nuklear/ui/option.rb
Instance Attribute Summary
Attributes inherited from Checkbox
Instance Method Summary collapse
-
#result(event, context) ⇒ Object
Override #result to prevent user deselecting this option by clicking on it.
- #to_command ⇒ Object
Methods inherited from Checkbox
#checked=, #checked?, #initialize
Methods inherited from Base
descendants, #dsl, inherited, #initialize
Methods included from Enableable
#disable, #disabled=, #disabled?, #enable, #enabled=, #enabled?
Methods included from Events
#event_listeners_for, #on, #trigger
Constructor Details
This class inherits a constructor from Nuklear::UI::Checkbox
Instance Method Details
#result(event, context) ⇒ Object
Override #result to prevent user deselecting this option by clicking on it. Checkbox can be deselected, option cannot. Only choosing a competing option can cause it to be deselected, and doing that does not call #result. See Nuklear::UI::OptionGroup.
12 13 14 |
# File 'lib/nuklear/ui/option.rb', line 12 def result(event, context) trigger event if event end |
#to_command ⇒ Object
4 5 6 |
# File 'lib/nuklear/ui/option.rb', line 4 def to_command [ :ui_option, text, checked? ] end |