about these sorts of resources or their side effects, so most are either set automatically by the ToggleButton or they
should be left to the user to configure for herself.
12.3.3 ToggleButton Pixmaps
The XmNselectPixmap resource specifies the pixmap to use when a ToggleButton is on (or selected). The
XmNset resource specifies the state of a ToggleButton; the button is selected when the resource is set to True. The
selected pixmap only applies if the XmN-labelType resource is set to XmPIXMAP. XmNlabelType is a Label
class resource, but it applies to ToggleButtons since they are subclassed from Label. the source code demonstrates the
creation of a ToggleButton and the use of the XmNselectPixmap resource. XtSetLanguageProc() is only
available in X11R5; there is no corresponding function in X11R4.
/* toggle.c −− demonstrate a simple toggle button. */
#include <Xm/ToggleB.h>
#include <Xm/RowColumn.h>
void
toggled(widget, client_data, call_data)
Widget widget;
XtPointer client_data;
XtPointer call_data;
{
XmToggleButtonCallbackStruct *state =
(XmToggleButtonCallbackStruct *) call_data;
printf ("%s: %s0, XtName (widget), state−>set? "on" : "off");
}
main(argc, argv)
int argc;
char *argv[];
{
Widget toplevel, rowcol, toggle;
XtAppContext app;
Pixmap on, off;
Pixel fg, bg;
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaAppInitialize (&app, "Demos", NULL, 0,
&argc, argv, NULL, NULL);
rowcol = XtVaCreateWidget ("_rowcol",
xmRowColumnWidgetClass, toplevel,
XmNorientation, XmHORIZONTAL,
NULL); ...