Blob Blame History Raw
'\" t
...\" ToggleBA.sgm /main/16 1996/09/25 13:46:15 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 "XmToggleButton" "library call"
.SH "NAME"
\fBXmToggleButton\fP \(em The ToggleButton widget class
.iX "XmToggleButton"
.iX "widget class" "ToggleButton"
.SH "SYNOPSIS"
.PP
.nf
#include <Xm/ToggleB\&.h>
.fi
.SH "DESCRIPTION"
.PP
ToggleButton sets nontransitory state data within an
application\&. Usually this widget 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
\fB1-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
ToggleButton
implies a set or unset state\&.
In the case of a label and an indicator, an
empty indicator (square, diamond, or round) indicates that ToggleButton
is unset, and a filled indicator shows that it is
set\&. The indicator may be filled with a check mark, a cross, or the
select color\&. In the case of a pixmap
toggle, different pixmaps are used to display the set/unset
states\&.
ToggleButton 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 ToggleButton in a menu depends on
the type of menu system in which it resides\&.
By default, \fB<Btn1>\fP controls the behavior of the ToggleButton\&.
In addition, \fB<Btn3>\fP controls the behavior of the ToggleButton 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
ToggleButton uses the \fBXmQTmenuSystem\fP and
\fBXmQTspecifyRenderTable\fP traits\&.
.SS "Classes"
.PP
ToggleButton inherits behavior, resources, and traits from
\fBCore\fP, \fBXmPrimitive\fP, and \fBXmLabel\fP\&.
.PP
The class pointer is \fBxmToggleButtonWidgetClass\fP\&.
.PP
The class name is \fBXmToggleButton\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.
\fBXmToggleButton 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 the list of callbacks called
when the ToggleButton is armed\&.
To arm this widget, press the active mouse button
while the pointer is inside the ToggleButton\&.
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 the list of callbacks called
when ToggleButton is disarmed\&.
To disarm this widget, press and release the active
mouse button while the pointer is inside the ToggleButton\&.
This widget is also disarmed
when the user moves out of the widget
and releases the mouse button when the pointer is outside the widget\&.
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
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\&.
.IP "" 10
If \fBXmNfillOnSelect\fP is True, \fBXmNset\fP is \fBXmSET\fP, and
\fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP the ToggleButton\&'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 ToggleButton \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 ToggleButton \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 is also used as the background color when all of the following conditions
are met: the button is armed in a menu, the
\fBXmNenableEtchedInMenu\fP resource is \fBTrue\fP,
the \fBXmNindicatorOn\fP resource is \fBFalse\fP, and the
\fBXmNfillOnSelect\fP resource is \fBTrue\fP\&.
.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 ToggleButton is selected,
the button is insensitive, and the Label resource
\fBXmNlabelType\fP is set to \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&.
If the ToggleButton 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 when \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
and the ToggleButton is selected\&.
When the ToggleButton is unselected,
the pixmap specified in the Label\&'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 ToggleButton 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 the list of callbacks called
when the ToggleButton value
is changed\&. To change the value,
press and release the active mouse button while the pointer
is inside the ToggleButton\&. This action
also causes this widget 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 ToggleButton is in a menu, the default value is False\&.
When the ToggleButton is in a RadioBox, the default value is True\&.
.SS "Inherited Resources"
.PP
ToggleButton 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.
\fBXmLabel 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
_____
XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGCSG
_____
XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG
_____
XmNpixmapTextPaddingXmCSpaceDimension2CSG
_____
XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG
_____
XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG
_____
XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmPrimitive Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG
_____
XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNconvertCallbackXmCCallbackXtCallbackListNULLC
_____
XmNforegroundXmCForegroundPixeldynamicCSG
_____
XmNhelpCallbackXmCCallbackXtCallbackListNULLC
_____
XmNhighlightColorXmCHighlightColorPixeldynamicCSG
_____
XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG
_____
XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG
_____
XmNhighlightThicknessXmCHighlightThicknessDimension2CSG
_____
XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG
_____
XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG
_____
XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC
_____
XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG
_____
XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG
_____
XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG
_____
XmNtraversalOnXmCTraversalOnBooleanTrueCSG
_____
XmNunitTypeXmCUnitTypeunsigned chardynamicCSG
_____
XmNuserDataXmCUserDataXtPointerNULLCSG
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBCore Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG
_____
XmNancestorSensitiveXmCSensitiveBooleandynamicG
_____
XmNbackgroundXmCBackgroundPixeldynamicCSG
_____
XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG
_____
XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNborderWidthXmCBorderWidthDimension0CSG
_____
XmNcolormapXmCColormapColormapdynamicCG
_____
XmNdepthXmCDepthintdynamicCG
_____
XmNdestroyCallbackXmCCallbackXtCallbackListNULLC
_____
XmNheightXmCHeightDimensiondynamicCSG
_____
XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC
_____
XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG
_____
XmNscreenXmCScreenScreen *dynamicCG
_____
XmNsensitiveXmCSensitiveBooleanTrueCSG
_____
XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG
_____
XmNwidthXmCWidthDimensiondynamicCSG
_____
XmNxXmCPositionPosition0CSG
_____
XmNyXmCPositionPosition0CSG
_____
.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 ToggleButton\&'s state, either
\fBXmSET\fP (selected), \fBXmUNSET\fP (unselected), or
\fBXmINDETERMINATE\fP (neither)\&.
Note that the reported state is the state that the ToggleButton
is in after the \fIevent\fP has been processed\&. For example,
suppose that a user clicks on a ToggleButton to change it from
the unselected state to the selected state\&. In this case,
ToggleButton changes the value of \fIset\fP from \fBXmUNSET\fP
to \fBXmSET\fP prior to calling the callback\&.
.SS "Translations"
.PP
\fBXmToggleButton\fP includes translations from \fIPrimitive\fP\&.
Additional \fBXmToggleButton\fP translations for buttons not in a
menu system are described in the following list\&.
.PP
Note that altering translations in \fB#override\fP
or \fB#augment\fP mode is undefined\&.
.PP
The following key names are listed in the
X standard key event translation table syntax\&.
This format is the one used by Motif to
specify the widget actions corresponding to a given key\&.
A brief overview of the format is provided under
\fBVirtualBindings\fP(3)\&.
For a complete description of the format, please refer to the
X Toolkit Instrinsics Documentation\&.
.IP "\fBc<Btn1Down>\fP:" 10
ButtonTakeFocus()
.IP "\fB\(apc\fP\fB<Btn1Down>\fP:" 10
Arm()
.IP "\fB\(apc\fP\fB<Btn1Up>\fP:" 10
Select() Disarm()
.IP "\fB<Btn2Down>\fP:" 10
ProcessDrag()
.IP "\fB:\fP\fB<Key>\fP\fB<osfActivate>\fP:" 10
PrimitiveParentActivate()
.IP "\fB:\fP\fB<Key>\fP\fB<osfCancel>\fP:" 10
PrimitiveParentCancel()
.IP "\fB:\fP\fB<Key>\fP\fB<osfSelect>\fP:" 10
ArmAndActivate()
.IP "\fB:\fP\fB<Key>\fP\fB<osfHelp>\fP:" 10
Help()
.IP "\fB\(aps \(apm \(apa\fP \fB<Key>\fP\fBReturn\fP:" 10
PrimitiveParentActivate()
.IP "\fB\(aps \(apm \(apa\fP \fB<Key>\fP\fBspace\fP:" 10
ArmAndActivate()
.PP
\fBXmToggleButton\fP inherits menu traversal translations
from \fBXmLabel\fP\&.
Additional \fBXmToggleButton\fP translations for \fBToggleButtons\fP in a
menu system are described in the following list\&.
In a Popup menu system, \fB<Btn3>\fP also performs the \fB<Btn1>\fP
actions\&.
.IP "\fB<Btn2Down>\fP:" 10
ProcessDrag()
.IP "\fBc<Btn1Down>\fP:" 10
MenuButtonTakeFocus()
.IP "\fBc<Btn1Up>\fP:" 10
MenuButtonTakeFocusUp()
.IP "\fB\(apc\fP\fB<BtnDown>\fP:" 10
BtnDown()
.IP "\fB\(apc\fP\fB<BtnUp>\fP:" 10
BtnUp()
.IP "\fB:\fP\fB<Key>\fP\fB<osfSelect>\fP:" 10
ArmAndActivate()
.IP "\fB:\fP\fB<Key>\fP\fB<osfActivate>\fP:" 10
ArmAndActivate()
.IP "\fB:\fP\fB<Key>\fP\fB<osfHelp>\fP:" 10
Help()
.IP "\fB:\fP\fB<Key>\fP\fB<osfCancel>\fP:" 10
MenuEscape()
.IP "\fB\(aps \(apm \(apa\fP \fB<Key>\fP\fBReturn\fP:" 10
ArmAndActivate()
.IP "\fB\(aps \(apm \(apa\fP \fB<Key>\fP\fBspace\fP:" 10
ArmAndActivate()
.SS "Action Routines"
.PP
The \fBXmToggleButton\fP action routines are
.IP "Arm():" 10
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 callbacks\&.
.IP "" 10
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 action calls the \fBXmNarmCallback\fP callbacks\&.
.IP "ArmAndActivate():" 10
If the ToggleButton was previously set, unsets it; if the ToggleButton
was previously unset, sets it\&.
.IP "" 10
In a menu, this action
unposts all menus in the menu hierarchy\&.
Unless the button is already armed,
it calls the \fBXmNarmCallback\fP callbacks\&.
This action calls 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, and
\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\&.
This action calls the \fBXmNarmCallback\fP, \fBXmNvalueChangedCallback\fP, and
\fBXmNdisarmCallback\fP callbacks\&.
.IP "BtnDown():" 10
This action unposts any menus posted by the ToggleButton\&'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 "BtnUp():" 10
This action unposts all menus in the menu hierarchy\&.
If the ToggleButton was previously set, unsets it; if the ToggleButton
was previously unset, sets it\&.
It calls the \fBXmNvalueChangedCallback\fP callbacks and then the
\fBXmNdisarmCallback\fP callbacks\&.
.IP "ButtonTakeFocus():" 10
Causes the ToggleButton to take keyboard focus
when \fBCtrl<Btn1Down>\fP is pressed, without activating the widget\&.
.IP "Disarm():" 10
Calls the callbacks for \fBXmNdisarmCallback\fP\&.
.IP "Help():" 10
In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy
and 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 "MenuShellPopdownOne():" 10
In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu,
disarms the MenuBar CascadeButton and the MenuBar, and restores keyboard
focus to the widget that had the focus before the MenuBar was
entered\&.
In other Pulldown MenuPanes, unposts the menu\&.
.IP "" 10
In a Popup MenuPane, unposts the menu and restores keyboard focus to the
widget from which the menu was posted\&.
.IP "ProcessDrag():" 10
Drags the contents of a ToggleButton label, identified when
\fBBTransfer\fP is pressed\&.
This action sets the \fBXmNconvertProc\fP of the DragContext to a
function that calls the \fBXmNconvertCallback\fP procedures, possibly
multiple times, for the \fB_MOTIF_DROP\fP selection\&.
This action is undefined for ToggleButtons used in a menu system\&.
.IP "Select():" 10
If the pointer is within the button, takes the following actions:
If the button was previously unset, sets it; if the button was
previously set, unsets it\&.
This action calls the \fBXmNvalueChangedCallback\fP callbacks\&.
.SS "Additional Behavior"
.PP
This widget has the following additional behavior:
.IP "\fB<EnterWindow>\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 ToggleButton is not in a menu and the cursor leaves and then
reenters the ToggleButton\&'s window while the button is pressed, this
action restores the button\&'s armed appearance\&.
.IP "\fB<LeaveWindow>\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 ToggleButton is not in a menu and the cursor leaves the
ToggleButton\&'s window 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
\fBCore\fP(3),
\fBXmCreateRadioBox\fP(3),
\fBXmCreateToggleButton\fP(3),
\fBXmLabel\fP(3),
\fBXmPrimitive\fP(3),
\fBXmRowColumn\fP(3),
\fBXmToggleButtonGetState\fP(3),
\fBXmToggleButtonSetState\fP(3),
\fBXmVaCreateToggleButton\fP(3),
\fBXmVaCreateManagedToggleButton\fP(3)\&.