Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
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" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431