Next: Toggle Callbacks Up: Toggle Widgets Previous: Toggle Widgets

Toggle Basics

To create a single Toggle use XtVaCreateManagedWidget() with a xmToggleButtonWidgetClass pointer or use XmCreateToggleButton().

<Xm/ToggleB> holds definitions etc.

Several Toggle Resources are important:

XmNindicatorType
- Set resource to XmN_OF_MANY for a CheckBox or XmONE_OF_MANY for a RadioBox.
XmNindicatorOn
- Set True to turn indicator on. (Default False - off).
XmNindicatorSize
- Changes indicator size (in Pixels).

XmNlabelType
- XmSTRING or XmPIXMAP. Decides the type of label
XmNlabelString
- XmString label of Toggle.
XmNlabelPixmap
- Pixmap of (unselected) Toggle.
XmNselectPixmap
- Pixmap of selected Toggle.
XmNselectColour
- Colour of selected Toggle. (Pixel data type).

The Pixmap is a standard X data type. You can use XmGetPixmap() to load in a Pixmap from a file. (See Section of Graphics / XLib for more detail.)


Dave.Marshall@cm.cf.ac.uk
Tue May 24 16:52:56 BST 1994