Blob Blame History Raw
'\" t
...\" ToggleBB.sgm /main/15 1996/09/25 13:46:27 cdedoc $
.de P!
.fl
\!!1 setgray
.fl
\\&.\"
.fl
\!!0 setgray
.fl			\" force out current output buffer
\!!save /psv exch def currentpoint translate 0 0 moveto
\!!/showpage{}def
.fl			\" prolog
.sy sed -e 's/^/!/' \\$1\" bring in postscript file
\!!psv restore
.
.de pF
.ie     \\*(f1 .ds f1 \\n(.f
.el .ie \\*(f2 .ds f2 \\n(.f
.el .ie \\*(f3 .ds f3 \\n(.f
.el .ie \\*(f4 .ds f4 \\n(.f
.el .tm ? font overflow
.ft \\$1
..
.de fP
.ie     !\\*(f4 \{\
.	ft \\*(f4
.	ds f4\"
'	br \}
.el .ie !\\*(f3 \{\
.	ft \\*(f3
.	ds f3\"
'	br \}
.el .ie !\\*(f2 \{\
.	ft \\*(f2
.	ds f2\"
'	br \}
.el .ie !\\*(f1 \{\
.	ft \\*(f1
.	ds f1\"
'	br \}
.el .tm ? font underflow
..
.ds f1\"
.ds f2\"
.ds f3\"
.ds f4\"
.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 
.TH "XmToggleButtonGadget" "library call"
.SH "NAME"
\fBXmToggleButtonGadget\fP \(em The ToggleButtonGadget widget class
.iX "XmToggleButtonGadget"
.iX "widget class" "ToggleButtonGadget"
.SH "SYNOPSIS"
.PP
.nf
#include <Xm/ToggleBG\&.h>
.fi
.SH "DESCRIPTION"
.PP
ToggleButtonGadget sets nontransitory state data within an
application\&. Usually this gadget consists of an indicator
(square, diamond, or round)
with either text or a pixmap on one side of it\&.
However,
it can also consist of just text or a pixmap without the indicator\&.
.PP
The toggle graphics display a \fB1-of-many\fP, \fBN-of-many\fP, or
\fBN-of-many-round\fP selection state\&.
When a toggle indicator is displayed, a square indicator shows an
\fBN-of-many\fP
selection state, a diamond-shaped indicator shows a
\fB1-of-many\fP selection state, and a circle-shaped indicator shows a
\fB1-of-many-round\fP selection state\&.
.PP
ToggleButtonGadget
implies a set or unset state\&.
In the case of a label and an indicator, an
empty indicator (square, diamond, or round) indicates that
ToggleButtonGadget
is unset, and a filled indicator shows that it is
set\&. The indicator may be filled with a check mark or the
select color\&. In the case of a pixmap
toggle, different pixmaps are used to display the set/unset
states\&.
ToggleButtonGadget can also indicate an indeterminate state\&. In the case of
a label and an indicator, an indeterminate state is indicated by a
stippled flat box\&.
In the case of a pixmap toggle, a different pixmap is used to display
the indeterminate state\&.
.PP
The default behavior associated with a ToggleButtonGadget in a menu depends on
the type of menu system in which it resides\&.
By default, \fB<Btn1>\fP controls the behavior of the ToggleButtonGadget\&.
In addition, \fB<Btn3>\fP controls the behavior of the ToggleButtonGadget if
it resides in a PopupMenu system\&.
The actual mouse button used is determined by its RowColumn parent\&.
.PP
Label\&'s resource \fBXmNmarginLeft\fP may
be increased
to accommodate the toggle indicator when it is created\&.
.PP
ToggleButtonGadget uses the \fBXmQTmenuSystem\fP and
\fBXmQTspecifyRenderTable\fP traits\&.
.SS "Classes"
.PP
ToggleButtonGadget inherits behavior,
resources, and traits from \fBObject\fP, \fBRectObj\fP, \fBXmGadget\fP
and \fBXmLabelGadget\fP\&.
.PP
The class pointer is \fBxmToggleButtonGadgetClass\fP\&.
.PP
The class name is \fBXmToggleButtonGadget\fP\&.
.SS "New Resources"
.PP
The following table defines a set of widget resources used by the programmer
to specify data\&. The programmer can also set the resource values for the
inherited classes to set attributes for this widget\&. To reference a
resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or
\fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined
values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use
the remaining letters (in either lowercase or uppercase, but include any
underscores between
words)\&.
The codes in the access column indicate if the given resource can be
set at creation time (C),
set by using \fBXtSetValues\fP (S),
retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&.
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmToggleButtonGadget Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNarmCallbackXmCArmCallbackXtCallbackListNULLC
_____
XmNdetailShadowThicknessXmCDetailShadowThicknessDimension2CSG
_____
XmNdisarmCallbackXmCDisarmCallbackXtCallbackListNULLC
_____
XmNfillOnSelectXmCFillOnSelectBooleandynamicCSG
_____
XmNindeterminatePixmapXmCIndeterminatePixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNindicatorOnXmCIndicatorOnunsigned charXmINDICATOR_FILLCSG
_____
XmNindicatorSizeXmCIndicatorSizeDimensiondynamicCSG
_____
XmNindicatorTypeXmCIndicatorTypeunsigned chardynamicCSG
_____
XmNselectColorXmCSelectColorPixeldynamicCSG
_____
XmNselectInsensitivePixmapXmCSelectInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNselectPixmapXmCSelectPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNsetXmCSetunsigned charXmUNSETCSG
_____
XmNspacingXmCSpacingDimension4CSG
_____
XmNtoggleModeXmCToggleModeunsigned charXmTOGGLE_BOOLEANCSG
_____
XmNunselectColorXmCUnselectColorPixeldynamicCSG
_____
XmNvalueChangedCallbackXmCValueChangedCallbackXtCallbackListNULLC
_____
XmNvisibleWhenOffXmCVisibleWhenOffBooleandynamicCSG
_____
.TE
.IP "\fBXmNarmCallback\fP" 10
Specifies a list of callbacks
that is called when the ToggleButtonGadget is armed\&.
To arm this gadget, press the active mouse button
while the pointer is inside the ToggleButtonGadget\&.
For this callback, the reason is \fBXmCR_ARM\fP\&.
.IP "\fBXmNdetailShadowThickness\fP" 10
Specifies the thickness of the indicator shadow\&. The default thickness
is 2 pixels\&.
.IP "\fBXmNdisarmCallback\fP" 10
Specifies a list of callbacks
called when ToggleButtonGadget is disarmed\&.
To disarm this gadget, press and release the active
mouse button while the pointer is inside the ToggleButtonGadget\&.
The gadget is also disarmed
when the user moves out of the gadget
and releases the mouse button when the pointer is outside the gadget\&.
For this callback, the reason is \fBXmCR_DISARM\fP\&.
.IP "\fBXmNfillOnSelect\fP" 10
Fills the indicator with the color specified in
\fBXmNselectColor\fP and switches the top and bottom shadow
colors when set to True\&. If unset, fills the indicator with the
unselect color\&. If indeterminate, fills the indicator with
half select color and half unselect color\&.
Otherwise, it switches only the top
and bottom shadow colors\&. The default is set
True only if a box type of indicator
(such as a check box) is specified, or if the \fBXmNindicatorType\fP is a
\fB1-of\fP type and a toggle indicator is drawn\&.
If \fBXmNfillOnSelect\fP is True, \fBXmNset\fP is \fBXmSET\fP, and
\fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP the ToggleButtonGadget\&'s
background is set to \fBXmNselectColor\fP\&. For the other
\fBXmNindicatorOn\fP values, only the indicator is filled with
\fBXmNselectColor\fP\&.
.IP "\fBXmNindeterminateInsensitivePixmap\fP" 10
Specifies the pixmap to be displayed as the button face when
the Label \fBXmNlableType\fP resource is \fBXmPIXMAP\fP or
\fBXmPIXMAP_AND_STRING\fP, the ToggleButtonGadget \fBXmNset\fP
resource is \fBXmINDETERMINATE\fP,
and the \fBCore\fP \fBXmNsensitive\fP resource is False\&.
.IP "\fBXmNindeterminatePixmap\fP" 10
Specifies the pixmap to be displayed as the button face when
the Label \fBXmNlableType\fP resource is \fBXmPIXMAP\fP or
\fBXmPIXMAP_AND_STRING\fP,
the ToggleButtonGadget \fBXmNset\fP resource is \fBXmINDETERMINATE\fP,
and the \fBCore\fP \fBXmNsensitive\fP resource is True\&.
.IP "\fBXmNindicatorOn\fP" 10
Specifies that if a toggle indicator is to be drawn, it will be drawn
to one side of the toggle
text or pixmap, depending on the \fBXmNlayoutDirection\fP resource of
the widget\&. The default value is \fBXmINDICATOR_FILL\fP\&.
Toggles accept the following values:
.RS
.IP "\fBXmINDICATOR_NONE\fP" 10
No space is allocated
for the indicator, and it is not displayed\&. Any shadows around the
entire widget are switched when the toggle is selected or unselected\&.
.IP "\fBXmINDICATOR_BOX\fP" 10
The toggle indicator is in the shape of a shadowed box\&.
.IP "\fBXmINDICATOR_FILL\fP" 10
If the value of the
\fBXmDisplay XmNenableToggleVisual\fP
resource is
\fBTrue\fP
, the visuals are those of
\fBXmINDICATOR_CHECK_BOX\fP
; if
\fBFalse\fP
, the indicator visuals are those of
\fBXmINDICATOR_BOX\fP\&.
.IP "\fBXmINDICATOR_CHECK\fP" 10
The toggle indicator is in the shape of a checkmark in the
foreground color\&.
.IP "\fBXmINDICATOR_CHECK_BOX\fP" 10
The toggle indicator is in the shape of a checkmark enclosed in a box\&.
This is the default if the \fBXmDisplay XmNenableToggleVisual\fP
resource is set\&.
.IP "\fBXmINDICATOR_CROSS_BOX\fP" 10
The toggle indicator is in the shape of a cross enclosed in a box\&.
.IP "\fBXmINDICATOR_CROSS\fP" 10
The toggle indicator is in the shape of a cross\&.
.RE
.IP "" 10
All ToggleButton checks and crosses should be drawn in the
foreground color\&.
.IP "" 10
If this resource is not \fBXmINDICATOR_NONE\fP, it will control the
appearance of the toggle visual\&. If \fBXmNset\fP is
\fBXmINDETERMINATE\fP and \fBXmNindicatorOn\fP is not
\fBXmINDICATOR_NONE\fP, this resource
shows a stippled flat box\&.
If \fBXmNset\fP is \fBXmINDETERMINATE\fP, \fBXmNindicatorOn\fP is
\fBXmINDICATOR_NONE\fP, and \fBXmNtoggleMode\fP is
\fBXmTOGGLE_INDETERMINATE\fP, the label and the ToggleButton are stippled with
a combination of the \fBXmNselectColor\fP and
the \fBXmNunselectColor\fP color,
and the border is flat\&.
.IP "\fBXmNindicatorSize\fP" 10
Sets the size of the indicator\&.
If no value is specified, the size of the indicator is based on the size
of the label string or pixmap\&.
If the label string or pixmap changes, the size of the indicator is
recomputed based on the size of the label string or pixmap\&.
Once a
value has been specified for \fBXmNindicatorSize\fP, the
indicator has that size, regardless of the size of the label string or
pixmap, until a new value is specified\&.
The size of indicators inside menus may differ from those outside of menus\&.
Note that a change in this resource may also cause a change in the
values of the inherited resources \fBXmNmarginTop\fP,
\fBXmNmarginBottom\fP, and \fBXmNmarginLeft\fP\&.
.IP "\fBXmNindicatorType\fP" 10
Specifies if the indicator is a \fB1-of\fP or
\fBN-of\fP indicator\&. For the \fB1-of\fP indicator, the
value can be \fBXmONE_OF_MANY\fP,
\fBXmONE_OF_MANY_ROUND\fP, or
\fBXmONE_OF_MANY_DIAMOND\fP\&.
For the \fBN-of\fP indicator,
the value is \fBXmN_OF_MANY\fP\&.
This value specifies only the visuals and does not enforce the
behavior\&. When the ToggleButton is in a radio box, the default is
\fBXmONE_OF_MANY\fP; otherwise,
the default is
\fBXmN_OF_MANY\fP\&. Legal values
are:
.RS
.IP "\fBXmONE_OF_MANY\fP" 10
When the Display \fBXmNenableToggleVisual\fP
resource is set,
indicators are drawn with the same appearance as
\fBXmONE_OF_MANY_ROUND\fP;
otherwise, they appear the same as
\fBXmONE_OF_MANY_DIAMOND\fP\&.
.IP "\fBXmN_OF_MANY\fP" 10
The indicators are drawn as specified by the
\fBXmNindicatorOn\fP
resource\&.
.IP "\fBXmONE_OF_MANY_ROUND\fP" 10
A shadowed circle\&.
.IP "\fBXmONE_OF_MANY_DIAMOND\fP" 10
A shadowed diamond\&.
.RE
.IP "\fBXmNselectColor\fP" 10
Allows the application to specify what color fills
the center of the square, diamond-shaped, or round indicator when it is set\&.
If this color is the same as either the top or the bottom shadow color of the
indicator, a one-pixel-wide margin is left between the shadows and the fill;
otherwise, it is filled completely\&.
The results of this resource depend on the value of the Display
resource \fBXmNenableToggleColor\fP\&. A value of True causes the fill
color to use the \fBXmHIGHLIGHT_COLOR\fP color by default\&. A value of False
causes the fill
color to use the background color\&.
This resource\&'s default for a color display is a color between the background
and the bottom shadow color\&. For a monochrome display, the default is set to
the foreground color\&. To set the background of the button to
\fBXmNselectColor\fP when \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP,
the value of
\fBXmNfillOnSelect\fP must be explicitly set to True\&.
.IP "" 10
This resource can take the following values:
.RS
.IP "\fBXmDEFAULT_SELECT_COLOR\fP" 10
Is the same as the current dynamic default, which is a color between
the background and the bottom shadow color\&.
.IP "\fBXmREVERSED_GROUND_COLORS\fP" 10
Forces the select color to the
foreground color and causes the default color of any text rendered over the
select color to be in the background color\&.
.IP "\fBXmHIGHLIGHT_COLOR\fP" 10
Forces the fill color to use the highlight color\&.
.RE
.IP "\fBXmNselectInsensitivePixmap\fP" 10
Specifies a pixmap used as the button face when the ToggleButtonGadget
is selected,
the button is insensitive, and the LabelGadget resource \fBXmNlabelType\fP
is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&. If the ToggleButtonGadget
is unselected and the button is insensitive, the pixmap in
\fBXmNlabelInsensitivePixmap\fP is used as the button face\&.
If no value is specified for \fBXmNlabelInsensitivePixmap\fP, that
resource is set to the value specified for
\fBXmNselectInsensitivePixmap\fP\&.
.IP "\fBXmNselectPixmap\fP" 10
Specifies the pixmap to be used as the button
face if \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, and
the ToggleButtonGadget is selected\&.
When the ToggleButtonGadget is unselected,
the pixmap specified in LabelGadget\&'s \fBXmNlabelPixmap\fP is used\&.
If no value is specified for \fBXmNlabelPixmap\fP, that resource is set
to the value specified for \fBXmNselectPixmap\fP\&.
.IP "\fBXmNset\fP" 10
Represents the state of the ToggleButton\&. A value of \fBXmUNSET\fP indicates
that the ToggleButton is not set\&. A value of \fBXmSET\fP indicates that
the ToggleButton is set\&. A value of \fBXmINDETERMINATE\fP indicates that the
ToggleButton is in an indeterminate state (neither set nor unset)\&.
The ToggleButton states cycle through in the order of \fBXmSET\fP,
\fBXmINDETERMINATE\fP (if \fBXmNtoggleMode\fP is set to
\fBXmTOGGLE_INDETERMINATE\fP), and \fBXmUNSET\fP, and then
back around to \fBXmSET\fP\&. If \fBXmNtoggleMode\fP is
set to \fBXmTOGGLE_BOOLEAN\fP, then the ToggleButton states cycle
through in the order of \fBXmSET\fP, then \fBXmUNSET\fP, and then
back around to \fBXmSET\fP\&.
Setting this resource sets the state of the
ToggleButton\&.
.IP "\fBXmNspacing\fP" 10
Specifies the amount of spacing between the toggle indicator and the
toggle label (text or pixmap)\&.
.IP "\fBXmNtoggleMode\fP" 10
Specifies the mode of the ToggleButtonGadget as either
\fBXmTOGGLE_BOOLEAN\fP or \fBXmTOGGLE_INDETERMINATE\fP\&. The
\fBXmTOGGLE_INDETERMINATE\fP value allows the \fBXmNset\fP resource to
be able to accept the values \fBXmINDETERMINATE\fP, \fBXmSET\fP, and
\fBXmUNSET\fP\&. The \fBXmNtoggleMode\fP resource is forced to
\fBXmTOGGLE_BOOLEAN\fP if the toggle is in an \fBXmRowColumn\fP widget
whose radio behavior is \fBXmONE_OF_MANY\fP\&. In
\fBXmTOGGLE_BOOLEAN\fP mode, the \fBXmNset\fP resource can only accept
\fBXmSET\fP and \fBXmUNSET\fP\&.
.IP "\fBXmNunselectColor\fP" 10
Allows the application to specify what color fills
the center of the square, diamond-shaped, or round indicator when it
is not set\&.
If this color is the same as either the top or the bottom shadow color of the
indicator, a one-pixel-wide margin is left between the shadows and the fill;
otherwise, it is filled completely\&.
This resource\&'s default for a color display is \fBXmNbackground\fP\&.
For a monochrome display, the default is set to
the background color\&. To set the background of the button to
\fBXmNunselectColor\fP when \fBXmNindicatorOn\fP is
\fBXmINDICATOR_NONE\fP, the value of
\fBXmNfillOnSelect\fP must be explicitly set to True\&. This resource
acts like the \fBXmNselectColor\fP resource, but for the case when
\fBXmNset\fP is \fBXmUNSET\fP\&.
.IP "\fBXmNvalueChangedCallback\fP" 10
Specifies a list of callbacks
called when the ToggleButtonGadget value
is changed\&. To change the value,
press and release the active mouse button while the pointer
is inside the ToggleButtonGadget\&. This action
also causes the gadget to be disarmed\&.
For this callback, the reason is \fBXmCR_VALUE_CHANGED\fP\&.
.IP "\fBXmNvisibleWhenOff\fP" 10
Indicates that the toggle indicator is visible in the unselected state when
the Boolean value is True\&.
When the ToggleButtonGadget is in a menu, the default value is False\&.
When the ToggleButtonGadget is in a RadioBox, the default value is True\&.
.SS "Inherited Resources"
.PP
ToggleButtonGadget inherits behavior and resources from the
superclasses described in the following tables\&.
For a complete description of each resource, refer to the
reference page for that superclass\&.
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmLabelGadget Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNacceleratorXmCAcceleratorStringNULLCSG
_____
XmNacceleratorTextXmCAcceleratorTextXmStringNULLCSG
_____
XmNalignmentXmCAlignmentunsigned chardynamicCSG
_____
XmNfontListXmCFontListXmFontListdynamicCSG
_____
XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNlabelStringXmCXmStringXmStringdynamicCSG
_____
XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG
_____
XmNmarginBottomXmCMarginBottomDimensiondynamicCSG
_____
XmNmarginHeightXmCMarginHeightDimension2CSG
_____
XmNmarginLeftXmCMarginLeftDimensiondynamicCSG
_____
XmNmarginRightXmCMarginRightDimension0CSG
_____
XmNmarginTopXmCMarginTopDimensiondynamicCSG
_____
XmNmarginWidthXmCMarginWidthDimension2CSG
_____
XmNmnemonicXmCMnemonicKeySymNULLCSG
_____
XmNmnemonicCharSetXmCMnemonicCharSetStringdynamicCSG
_____
XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG
_____
XmNpixmapTextPaddingXmCSpaceDimension2CSG
_____
XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG
_____
XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG
_____
XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmGadget Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNbackgroundXmCBackgroundPixeldynamicCSG
_____
XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG
_____
XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG
_____
XmNhelpCallbackXmCCallbackXtCallbackListNULLC
_____
XmNforegroundXmCForegroundPixeldynamicCSG
_____
XmNhighlightColorXmCHighlightColorPixeldynamicCSG
_____
XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG
_____
XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG
_____
XmNhighlightThicknessXmCHighlightThicknessDimension2CSG
_____
XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG
_____
XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG
_____
XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG
_____
XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG
_____
XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG
_____
XmNtraversalOnXmCTraversalOnBooleanTrueCSG
_____
XmNunitTypeXmCUnitTypeunsigned chardynamicCSG
_____
XmNuserDataXmCUserDataXtPointerNULLCSG
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBRectObj Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNancestorSensitiveXmCSensitiveBooleandynamicG
_____
XmNborderWidthXmCBorderWidthDimension0N/A
_____
XmNheightXmCHeightDimensiondynamicCSG
_____
XmNsensitiveXmCSensitiveBooleanTrueCSG
_____
XmNwidthXmCWidthDimensiondynamicCSG
_____
XmNxXmCPositionPosition0CSG
_____
XmNyXmCPositionPosition0CSG
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBObject Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNdestroyCallbackXmCCallbackXtCallbackListNULLC
_____
.TE
.SS "Callback Information"
.PP
A pointer to the following structure is passed to each callback:
.PP
.nf
typedef struct
{
        int \fIreason\fP;
        XEvent \fI* event\fP;
        int \fIset\fP;
} XmToggleButtonCallbackStruct;
.fi
.IP "\fIreason\fP" 10
Indicates why the callback was invoked
.IP "\fIevent\fP" 10
Points to the \fBXEvent\fP that triggered the callback
.IP "\fIset\fP" 10
Reflects the ToggleButtonGadget\&'s state, either
\fBXmSET\fP (selected), \fBXmUNSET\fP (unselected), or
\fBXmINDETERMINATE\fP (neither)\&.
Note that the reported state is the state that the ToggleButtonGadget
is in after the \fIevent\fP has been processed\&. For example,
suppose that a user clicks on a ToggleButtonGadget to change it from
the unselected state to the selected state\&. In this case,
ToggleButtonGadget changes the value of \fIset\fP from \fBXmUNSET\fP
to \fBXmSET\fP prior to calling the callback\&.
.SS "Behavior"
.PP
\fBXmToggleButtonGadget\fP includes behavior from \fBXmGadget\fP\&.
\fBXmToggleButtonGadget\fP includes menu traversal behavior from \fBXmLabelGadget\fP\&.
Additional \fBXmToggleButtonGadget\fP behavior is described in the
following list:
.IP "\fB<Btn2Down>\fP:" 10
Drags the contents of a ToggleButtonGadget label, identified when
\fB<Btn2>\fP is pressed\&.
This action is undefined for ToggleButtonGadgets used in a menu system\&.
.IP "\fB<Btn1Down>\fP:" 10
In a menu, this action unposts any menus posted by the ToggleButtonGadget\&'s
parent menu,
disables keyboard traversal for the menu, and enables mouse traversal
for the menu\&.
It draws the shadow in the armed state
and, unless the button is already armed, calls the \fBXmNarmCallback\fP
callbacks\&.
.IP "" 10
Outside a menu, if the button was previously unset, this action does the
following:
if \fBXmNindicatorOn\fP is True, it draws the indicator shadow so that
the indicator looks pressed; if \fBXmNfillOnSelect\fP is True, it fills
the indicator with the color specified by \fBXmNselectColor\fP\&.
If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the
button looks pressed\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNselectPixmap\fP is used as the button face\&.
This resource calls the \fBXmNarmCallback\fP callbacks\&.
.IP "" 10
Outside a menu, if the button was previously set, this action does the
following:
if both \fBXmNindicatorOn\fP and \fBXmNvisibleWhenOff\fP are True, it
draws the indicator shadow so that the indicator looks raised; if
\fBXmNfillOnSelect\fP is True, it fills the indicator with the
background color\&.
If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the
button looks raised\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNlabelPixmap\fP is used as the button face\&.
This resource calls the \fBXmNarmCallback\fP callbacks\&.
.IP "\fB<Btn1Up>\fP:" 10
In a menu, this action
unposts all menus in the menu hierarchy\&.
If the ToggleButtonGadget was previously set, this action
unsets it; if the ToggleButtonGadget
was previously unset, this action sets it\&.
It calls the \fBXmNvalueChangedCallback\fP callbacks and then the
\fBXmNdisarmCallback\fP callbacks\&.
.IP "" 10
If the button is outside a menu and the pointer is within the button,
this action does the following:
if the button was previously unset, sets it; if the button was
previously set, unsets it\&.
This action calls the \fBXmNvalueChangedCallback\fP callbacks\&.
.IP "" 10
If the button is outside a menu, this action calls the \fBXmNdisarmCallback\fP
callbacks\&.
.IP "\fB<Key>\fP\fB<osfHelp>\fP:" 10
In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy
and,
when the shell\&'s keyboard focus policy is
\fBXmEXPLICIT\fP,
restores keyboard focus to the widget that had the focus before
the menu system was entered\&.
Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&.
If there are no help callbacks for this widget, this action calls the
help callbacks for the nearest ancestor that has them\&.
.IP "\fB<Key>\fP\fB<osfActivate>\fP:" 10
In a menu, this action unposts all menus in the menu hierarchy\&.
Unless the button is already armed, this action calls the \fBXmNarmCallback\fP
callbacks; and calls the \fBXmNvalueChangedCallback\fP and
\fBXmNdisarmCallback\fP callbacks\&. Outside a menu,
if the parent is a manager, this action passes the event to the parent\&.
.IP "\fB<Key>\fP\fB<osfSelect>\fP:" 10
If the ToggleButtonGadget was previously set, this action unsets it; if the
ToggleButtonGadget was previously unset, this action sets it\&.
.IP "" 10
In a menu, this action
unposts all menus in the menu hierarchy\&.
Unless the button is already armed,
this action calls the \fBXmNarmCallback\fP,
the \fBXmNvalueChangedCallback\fP, and
\fBXmNdisarmCallback\fP callbacks\&.
.IP "" 10
Outside a menu, if the button was previously unset, this action does the
following:
If \fBXmNindicatorOn\fP is True, it draws the indicator shadow so that
the indicator looks pressed; if \fBXmNfillOnSelect\fP is True, it fills
the indicator with the color specified by \fBXmNselectColor\fP\&.
If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the
button looks pressed\&.
If \fBXmNlabelType\fP
is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNselectPixmap\fP is
used as the button face\&.
This action calls the \fBXmNarmCallback\fP, \fBXmNvalueChangedCallback\fP,
\fBXmNdisarmCallback\fP callbacks\&.
.IP "" 10
Outside a menu, if the button was previously set, this action does the
following:
If both \fBXmNindicatorOn\fP and \fBXmNvisibleWhenOff\fP are True, it
draws the indicator shadow so that the indicator looks raised; if
\fBXmNfillOnSelect\fP is True, it fills the indicator with the
background color\&.
If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the
button looks raised\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNlabelPixmap\fP is used as the button face\&.
Calls the \fBXmNarmCallback\fP, \fBXmNvalueChangedCallback\fP, and
\fBXmNdisarmCallback\fP callbacks\&.
.IP "\fB<Key>\fP\fB<osfCancel>\fP:" 10
In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu,
disarms the MenuBar CascadeButton and the MenuBar, and,
when the shell\&'s keyboard focus policy is
\fBXmEXPLICIT\fP,
restores keyboard
focus to the widget that had the focus before the MenuBar was
entered\&.
In other Pulldown MenuPanes, this action unposts the menu\&.
Outside a menu, if the parent is a manager, this action passes the event to the
parent\&.
.IP "" 10
In a Popup MenuPane, this action unposts the menu and restores keyboard focus to the
widget from which the menu was posted\&.
.IP "\fB<Enter>\fP:" 10
In a menu, if keyboard traversal is enabled, this action does nothing\&.
Otherwise, it draws the shadow in the armed state and calls the
\fBXmNarmCallback\fP callbacks\&.
.IP "" 10
If the ToggleButtonGadget is not in a menu and the cursor leaves and then
reenters the ToggleButtonGadget while the button is pressed, this
action restores the button\&'s armed appearance\&.
.IP "\fB<Leave>\fP:" 10
In a menu, if keyboard traversal is enabled, this action does nothing\&.
Otherwise, it draws the shadow in the unarmed state and calls the
\fBXmNdisarmCallback\fP callbacks\&.
.IP "" 10
If the ToggleButtonGadget is not in a menu and the cursor leaves the
ToggleButtonGadget while the button is pressed, this action restores
the button\&'s unarmed appearance\&.
.SS "Virtual Bindings"
.PP
The bindings for virtual keys are vendor specific\&.
For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&.
.SH "RELATED"
.PP
\fBObject\fP(3),
\fBRectObj\fP(3),
\fBXmCreateRadioBox\fP(3),
\fBXmCreateToggleButtonGadget\fP(3),
\fBXmGadget\fP(3),
\fBXmLabelGadget\fP(3),
\fBXmRowColumn\fP(3),
\fBXmToggleButtonGadgetGetState\fP(3),
\fBXmToggleButtonGadgetSetState\fP(3),
\fBXmVaCreateToggleButtonGadget\fP(3), and
\fBXmVaCreateManagedToggleButtonGadget\fP(3)\&.