Class: FX::RadioGroup
- Inherits:
-
Object
- Object
- FX::RadioGroup
- Defined in:
- lib/libGUIb16.rb,
lib/libGUIb14.rb
Instance Attribute Summary collapse
-
#radio_widgets ⇒ Object
readonly
Returns the value of attribute radio_widgets.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
Instance Method Summary collapse
- #add_radio(radio_widget, &block) ⇒ Object (also: #<<)
-
#initialize ⇒ RadioGroup
constructor
A new instance of RadioGroup.
- #select(radio_widget) ⇒ Object
Constructor Details
#initialize ⇒ RadioGroup
Returns a new instance of RadioGroup.
329 330 331 332 |
# File 'lib/libGUIb16.rb', line 329 def initialize @radio_widgets = [] @selected = nil end |
Instance Attribute Details
#radio_widgets ⇒ Object (readonly)
Returns the value of attribute radio_widgets.
333 334 335 |
# File 'lib/libGUIb16.rb', line 333 def @radio_widgets end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
352 353 354 |
# File 'lib/libGUIb16.rb', line 352 def selected @selected end |
Instance Method Details
#add_radio(radio_widget, &block) ⇒ Object Also known as: <<
334 335 336 337 338 339 340 |
# File 'lib/libGUIb16.rb', line 334 def add_radio(, &block) @radio_widgets << .connect(Fox::SEL_COMMAND) { select() yield if block } end |
#select(radio_widget) ⇒ Object
342 343 344 345 346 347 348 349 350 |
# File 'lib/libGUIb16.rb', line 342 def select @selected = event_selected @selected @radio_widgets.each do |w| w.state = (w == @selected) # only the selected widget is checked. rescue Exception puts $! end end |