Class: Iup::Radio
Overview
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, which is the child widget.
Attributes
- clientoffset
-
read-only, returns current offset of frame in its client as “widthxheight”.
- clientsize
-
read-only, returns current size of frame as “widthxheight”.
- expand
-
Allows container to fill available space in indicated direction. Values ‘no’ / ‘horizontal’ / ‘vertical’ / ‘yes’.
- position
-
read-only returns position in pixels within client window as “x,y”.
- value
-
Name identifier of the active toggle.
- value_handle
-
Changes the active toggle to given name.
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#initialize(toggles, &block) ⇒ Radio
constructor
Creates an instance of the radio container.
Methods inherited from Widget
#assign_handle, #enterwindow_cb, #getfocus_cb, #help_cb, #k_any, #killfocus_cb, #leavewindow_cb, #map_cb, #open_controls, #unmap_cb
Methods included from AttributeBuilders
#define_attribute, #define_id_attribute, #define_id_readonly, #define_id_writeonly, #define_property_attribute, #define_property_writeonly, #define_readonly, #define_writeonly
Methods included from CallbackSetter
Constructor Details
#initialize(toggles, &block) ⇒ Radio
Creates an instance of the radio container.
- toggles
-
a vbox or hbox containing the toggle controls
- block
-
optional block to set up the container’s attributes.
26 27 28 29 30 31 |
# File 'lib/wrapped/radio.rb', line 26 def initialize toggles, &block @handle = IupLib.IupRadio toggles.handle # run any provided block on instance, to set up further attributes self.instance_eval &block if block_given? end |