12.3.6 CheckBoxes
A CheckBox is similar to a RadioBox, except that there is no restriction on how many items may be selected at once.
A word processing program might use a CheckBox for non-exclusive settings, such as whether font smoothing,
bitmap smoothing, or both, should be applied.
Like RadioBoxes, CheckBoxes are implemented using RowColumn widgets and ToggleButton children. To allow
multiple items to be selected, the XmNradioBehavior resource is set to False. The convenience routine
XmVaCreateSimpleCheckBox() works just like the radio box creation routine, except that it turns off the
XmNradioBehavior resource. Rather than using this function, we can simply create a common RowColumn
widget without the aid of convenience functions and add ToggleButton children. With this technique, we have more
direct control over the resources that are set in the RowColumn, since we can specify exactly which ones we want
using the varargs interface for creating the widget.
the source code demonstrates how to create a CheckBox with a regular RowColumn widget.
XtSetLanguageProc() is only available in X11R5; there is no corresponding function in X11R4.
/* toggle_box.c −− demonstrate a homebrew ToggleBox. A static
* list of strings is used as the basis for a list of toggles.
* The callback routine toggled() is set for each toggle item.
* The client data for this routine is set to the enumerated
* value of the item with respect to the entire list. This value
* is treated as a bit which is toggled in "toggles_set" ...