class Iup::Radio
A Radio container is used to group toggle controls together, so that only one out of the group will be active at a time.
To use the Radio control, place the toggle controls within a vbox/hbox and add to the radio control.
Example
This example sets up two options: Perl and Ruby. Notice the use of assign_handle in the toggles to provide a meaningful name to the radio groupâs current value:
perl = Iup::Toggle.new('Perl') do |t| t.assign_handle 'perl' end ruby = Iup::Toggle.new('Ruby') do |t| t.assign_handle 'ruby' end exclusive = Iup::Radio.new(Iup::VBox.new(perl, ruby)) do |r| r.value = 'ruby' end
Attributes
Returns current offset of frame in its client as âwidthxheightâ.
Returns current size of frame as âwidthxheightâ.
Allows container to fill available space in indicated direction. Values ânoâ / âhorizontalâ / âverticalâ / âyesâ.
Returns position in pixels within client window as âx,yâ.
Name identifier of the active toggle.
Changes the active toggle to given name.
Public Class Methods
Source
# File lib/wrapped/radio.rb, line 33 def initialize toggles @handle = IupLib.IupRadio(toggles.handle) # run any provided block on instance, to set up further attributes yield self if block_given? end
Creates an instance of the radio container. If a block is given, the new instance is yielded to it.
-
toggles- a vbox or hbox containing the toggle controls