corresponding get function, XmToggleButtonSetState() determines if its parameter is a widget or gadget
internally, so you can use it on either a ToggleButton widget or a ToggleButton gadget.
XmToggleButtonGadgetSetState() can only be used on a gadget.
One important point to make about ToggleButtons is that, unlike PushButtons and DrawnButtons, the callback is not
typically used to take an action in the application. This point becomes clearer with groups of ToggleButtons, which
are commonly used to set the state of various variables. When the user has set the state as desired, she might tell the
application to apply the settings by clicking on an associated PushButton. For this reason, the callback routine for a
ToggleButton may simply set the state of a global variable; the value can then be used by other application functions.
Of course, like almost every object in Motif, a ToggleButton can be put to many uses. For example, a single
ToggleButton could be used to swap the foreground and background colors of a window as soon as the user selects the
button. An application that controls a CD player could have a Pause button represented by a ToggleButton.
12.3.5 RadioBoxes
When a group of ToggleButtons are used as part of an interface, it is in the form of a RadioBox or a CheckBox. The
primary difference between the two is the selection of the ToggleButtons within. In a RadioBox, only one item may be
selected at a time (analogous to old−style AM car radios). You push one button and the previously ...