Specifications

Athena Widget Set libXaw 1.0.7
3.10.4. Radio Groups
There are typically twotypes of radio groups desired by applications. The default translations for
the Toggle widget implement a "zero or one of many" radio group. This means that there may be
no more than one Toggle widget active,but there need not be anyToggle widgets active.
The other type of radio group is "one of many" and has the more strict policythat there will
always be exactly one radio button active.Toggle widgets can be used to provide this interface
with a slight modification to the translation table of each Toggle in the group.
<EnterWindow>: highlight(Always)
<LeaveWindow>: unhighlight( )
<Btn1Down>,<Btn1Up>: set( )notify( )
This translation table will not allowany Toggle to be unset except as a result of another Toggle
becoming set.Itisthe application programmer’sresponsibility to choose an initial state for the
radio group by setting the state resource of one of its member widgets to True.
3.10.5. Convenience Routines
The following functions alloweasy access to the Toggle widget’sradio group functionality.
3.10.5.1. Changing the Toggle’sRadio Group.
To enable an application to change the Toggle’sradio group, add the Toggle to a radio group, or
remove the Toggle from a radio group, use XawToggleChangeRadioGroup.
void XawToggleChangeRadioGroup(w, radio_group)
Widget w, radio_group;
w Specifies the Toggle widget.
radio_group Specifies anyToggle in the newradio group. If NULL then the Toggle will be
removedfrom anyradio group of which it is a member.
If a Toggle is already set in the newradio group, and the Toggle to be added is also set then the
previously set Toggle in the radio group is unset and its callback procedures are invoked.
Finding the Currently selected Toggle in a radio group of Toggles
To find the currently selected Toggle in a radio group of Toggle widgets use XawToggleGetCur-
rent.
XtPointer XawToggleGetCurrent(radio_group);
Widget radio_group;
radio_group Specifies anyToggle widget in the radio group.
The value returned by this function is the radioData of the Toggle in this radio group that is cur-
rently set. The default value for radioData is the name of that Toggle widget. If no Toggle is set
in the radio group specified then NULL is returned.
Changing the Toggle that is set in a radio group.
To change the Toggle that is currently set in a radio group use XawToggleSetCurrent.
void XawToggleSetCurrent(radio_group, radio_data);
Widget radio_group;
XtPointer radio_data;
radio_group Specifies anyToggle widget in the radio group.
radio_data Specifies the radioData identifying the Toggle that should be set in the radio
group specified by the radio_group argument.
56