Blob Blame History Raw
'\" t
...\" PushButB.sgm /main/11 1996/09/08 20:56:11 rws $
.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 "XmPushButtonGadget" "library call"
.SH "NAME"
\fBXmPushButtonGadget\fP \(em The PushButtonGadget widget class
.iX "XmPushButtonGadget"
.iX "widget class" "PushButtonGadget"
.SH "SYNOPSIS"
.PP
.nf
#include <Xm/PushBG\&.h>
.fi
.SH "DESCRIPTION"
.PP
PushButtonGadget issues commands within an application\&.
It consists of a text label or pixmap surrounded
by a border shadow\&.
When PushButtonGadget is selected, the shadow changes to give the appearance
that the PushButtonGadget has been pressed in\&. When PushButtonGadget is
unselected, the shadow changes to give the appearance that the PushButtonGadget is
out\&.
.PP
The default behavior associated with a PushButtonGadget in a menu depends on
the type of menu system in which it resides\&.
By default, \fB<Btn1>\fP controls the behavior of the PushButtonGadget\&.
In addition, \fB<Btn3>\fP controls the behavior of the PushButtonGadget if
it resides in a PopupMenu system\&.
The actual mouse button used is determined by its RowColumn parent\&.
.PP
Thickness for a second shadow may be specified with the
\fBXmNshowAsDefault\fP resource\&. If it has a nonzero value, the Label\&'s
\fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and
\fBXmNmarginBottom\fP resources may be modified to accommodate the second shadow\&.
.PP
If an initial value is specified for \fBXmNarmPixmap\fP but not for
\fBXmNlabelPixmap\fP, the \fBXmNarmPixmap\fP value is used for
\fBXmNlabelPixmap\fP\&.
.PP
PushButtonGadget uses the \fBXmQTmenuSystem\fP and
\fBXmQTspecifyRenderTable\fP traits, and
holds the \fBXmQactivatable\fP, \fBXmQTmenuSavvy\fP, and
\fBXmQTtakesDefault\fP traits\&.
.SS "Classes"
.PP
PushButtonGadget inherits behavior,
resources, and traits from \fBObject\fP, \fBRectObj\fP, \fBXmGadget\fP
and \fBXmLabelGadget\fP\&.
.PP
The class pointer is \fBxmPushButtonGadgetClass\fP\&.
.PP
The class name is \fBXmPushButtonGadget\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.
\fBXmPushButtonGadget Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNactivateCallbackXmCCallbackXtCallbackListNULLC
_____
XmNarmCallbackXmCCallbackXtCallbackListNULLC
_____
XmNarmColorXmCArmColorPixeldynamicCSG
_____
XmNarmPixmapXmCArmPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNdefaultButtonShadowThicknessXmCdefaultButtonShadowThicknessDimensiondynamicCSG
_____
XmNdisarmCallbackXmCCallbackXtCallbackListNULLC
_____
XmNfillOnArmXmCFillOnArmBooleanTrueCSG
_____
XmNmultiClickXmCMultiClickunsigned chardynamicCSG
_____
XmNshowAsDefaultXmCShowAsDefaultDimension0CSG
_____
.TE
.IP "\fBXmNactivateCallback\fP" 10
Specifies the list of callbacks
that is called when the PushButtonGadget is activated\&.
It is activated when the user presses
and releases the active mouse button while the
pointer is inside
the PushButtonGadget\&. Activating PushButtonGadget
also disarms it\&.
For this callback, the reason is \fBXmCR_ACTIVATE\fP\&.
This callback uses the \fBXmQTactivatable\fP trait\&.
.IP "\fBXmNarmCallback\fP" 10
Specifies the list of callbacks
that is called when PushButtonGadget is armed\&.
It is armed when the user presses the active
mouse button while the pointer is inside the PushButtonGadget\&.
For this callback, the reason is \fBXmCR_ARM\fP\&.
.IP "\fBXmNarmColor\fP" 10
Specifies the color with which to fill the armed button\&.
\fBXmNfillOnArm\fP must be set to True for this resource to have an effect\&.
The 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, and any text in the label appears in the background
color when the button is armed\&.
.IP "\fBXmNarmPixmap\fP" 10
Specifies the pixmap to be used as the button face if \fBXmNlabeltype\fP is
\fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP and PushButtonGadget is armed\&.
This resource is disabled when the PushButtonGadget is in a menu\&.
.IP "\fBXmNdefaultButtonShadowThickness\fP" 10
This resource specifies the width of the default button indicator shadow\&.
If this resource is 0 (zero), the width of the shadow comes from the value of
the \fBXmNshowAsDefault\fP resource\&. If this resource is greater than
zero, the \fBXmNshowAsDefault\fP resource is only used to specify whether
this button is the default\&.
The default value is the initial value of \fBXmNshowAsDefault\fP\&.
.IP "\fBXmNdisarmCallback\fP" 10
Specifies the list of callbacks
that is called when the PushButtonGadget is disarmed\&.
PushButtonGadget is disarmed when the user presses and releases the
active mouse button while the pointer is inside that
gadget\&.
For this callback, the reason is \fBXmCR_DISARM\fP\&.
.IP "\fBXmNfillOnArm\fP" 10
Forces the PushButtonGadget to fill the background of the button with the
color specified by \fBXmNarmColor\fP when the button is armed and when this
resource is set to True\&. If it is False, only the top and bottom
shadow colors are
switched\&. When the PushButtonGadget is in a menu, this resource is ignored
and assumed to be False\&.
.IP "\fBXmNmultiClick\fP" 10
If a button click is followed by another button click within the time
span specified by the display\&'s multiclick time, and this resource is
set to \fBXmMULTICLICK_DISCARD\fP, the second click is not processed\&.
If this resource is set to \fBXmMULTICLICK_KEEP\fP, the event
is processed and \fIclick_count\fP is incremented in the callback structure\&.
When the button is in a menu, the default is \fBXmMULTICLICK_DISCARD\fP;
otherwise, for a button not in a menu, the default value is
\fBXmMULTICLICK_KEEP\fP\&.
.IP "\fBXmNshowAsDefault\fP" 10
If \fBXmNdefaultButtonShadowThickness\fP is greater than 0 (zero), a value
greater than zero in this resource
specifies to mark this button as the default button\&.
If \fBXmNdefaultButtonShadowThickness\fP is 0, a value greater than
0 in this resource specifies to mark this button as the default
button with the shadow thickness specified by this resource\&.
The space between
the shadow and the default shadow is equal to the sum of both shadows\&.
The default value is 0\&.
When the Display resource \fBXmNdefaultButtonEmphasis\fP has a value of
\fBXmEXTERNAL_HIGHLIGHT\fP (the default), PushButton draws the
location cursor outside of the outer shadow\&. When this resource has a
value of \fBXmINTERNAL_HIGHLIGHT\fP, the highlight is drawn between
the inner and outer shadows\&.
When this value is not 0, the Label
\fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and
\fBXmNmarginBottom\fP resources
may be modified to accommodate the second shadow\&.
This resource is disabled when the PushButton is in a menu\&.
.SS "Inherited Resources"
.PP
PushButtonGadget 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
_____
XmNlabelPixmapXmCLabelPixmapPixmapdynamicCSG
_____
XmNlabelStringXmCXmStringXmStringdynamicCSG
_____
XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG
_____
XmNmarginBottomXmCMarginBottomDimensiondynamicCSG
_____
XmNmarginHeightXmCMarginHeightDimension2CSG
_____
XmNmarginLeftXmCMarginLeftDimensiondynamicCSG
_____
XmNmarginRightXmCMarginRightDimensiondynamicCSG
_____
XmNmarginTopXmCMarginTopDimensiondynamicCSG
_____
XmNmarginWidthXmCMarginWidthDimension2CSG
_____
XmNmnemonicXmCMnemonicKeySymNULLCSG
_____
XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG
_____
XmNpixmapTextPaddingXmCSpaceDimension2CSG
_____
XmNmnemonicCharSetXmCMnemonicCharSetStringdynamicCSG
_____
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
_____
XmNshadowThicknessXmCShadowThicknessDimension2CSG
_____
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 \fIclick_count\fP;
} XmPushButtonCallbackStruct;
.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 "\fIclick_count\fP" 10
Valid only when the reason is \fBXmCR_ACTIVATE\fP\&.
It contains the number of clicks in the last multiclick sequence
if the \fBXmNmultiClick\fP resource is set to \fBXmMULTICLICK_KEEP\fP;
otherwise it contains 1\&.
The activate callback is invoked for each click if \fBXmNmultiClick\fP
is set to \fBXmMULTICLICK_KEEP\fP\&.
.SS "Behavior"
.PP
\fBXmPushButtonGadget\fP includes behavior from \fBXmGadget\fP\&.
\fBXmPushButtonGadget\fP includes menu traversal behavior from
\fBXmLabelGadget\fP\&.
Additional behavior for XmPushButtonGadget is described in the following
list\&.
.IP "\fB<Btn2Down>\fP:" 10
Drags the contents of a PushButtonGadget label, identified when
\fB<Btn2>\fP is pressed\&.
This action is undefined for PushButtonGadgets used in a menu system\&.
.IP "\fB<Btn1Down>\fP:" 10
This action arms the PushButtonGadget\&.
.IP "" 10
In a menu, this action unposts any menus posted by the PushButtonGadget\&'s
parent menu, disables keyboard traversal for the menu, and enables mouse
traversal for the menu\&.
It draws the shadow in the armed state\&.
Unless the button is already armed, it calls the \fBXmNarmCallback\fP
callbacks\&.
.IP "" 10
If the button is not in a menu, this action draws the shadow in the
armed state\&.
If \fBXmNfillOnArm\fP is set
to True, it fills the button with the color specified by
\fBXmNarmColor\fP\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNarmPixmap\fP is used for the button face\&.
It calls the \fBXmNarmCallback\fP callbacks\&.
.IP "\fB<Btn1>\fP\fB(2+)\fP:" 10
If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does
nothing\&.
.IP "" 10
If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action
draws the shadow in the armed state\&.
If the button is not in a menu and if \fBXmNfillOnArm\fP is set
to True, it fills the button with the color specified by
\fBXmNarmColor\fP\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNarmPixmap\fP is used for the button face\&.
This action calls the \fBXmNarmCallback\fP callbacks\&.
.IP "\fB<Btn1Up>\fP:" 10
In a menu, this action unposts all menus in the menu hierarchy and
activates the PushButtonGadget\&.
It calls the \fBXmNactivateCallback\fP callbacks and then the
\fBXmNdisarmCallback\fP callbacks\&.
.IP "" 10
If the PushButtonGadget is not in a menu, this action draws the shadow in the
unarmed state\&.
If \fBXmNfillOnArm\fP is set to True, the background color reverts to
the unarmed color\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNlabelPixmap\fP is used for the button face\&.
If the pointer is still within the button,
this action calls the callbacks for \fBXmNactivateCallback\fP
and \fBXmNdisarmCallback\fP\&.
.IP "\fB<Btn1Up>\fP\fB(2+)\fP:" 10
If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does
nothing\&.
.IP "" 10
If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action
increments \fIclick_count\fP in the callback structure and
draws the shadow in the unarmed state\&.
If the button is not in a menu and if \fBXmNfillOnArm\fP is set to True,
the background color reverts to the unarmed color\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
\fBXmNlabelPixmap\fP is used for the button face\&.
If the pointer is within the PushButtonGadget, this action calls the
callbacks for \fBXmNactivateCallback\fP
and \fBXmNdisarmCallback\fP\&.
.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, and calls the \fBXmNarmCallback\fP
callbacks, the \fBXmNactivateCallback\fP and
the \fBXmNdisarmCallback\fP callbacks\&. Outside a menu, \fBKActivate\fP
has no effect\&.
For PushButtonGadgets outside of a menu, if the parent is a manager,
this action passes the event to the parent\&.
.IP "\fB<Key>\fP\fB<osfSelect>\fP:" 10
In a menu, this action
unposts all menus in the menu hierarchy,
unless the button is already armed,
and calls the \fBXmNarmCallback\fP callbacks\&.
This acton calls the \fBXmNactivateCallback\fP and
\fBXmNdisarmCallback\fP callbacks\&.
.IP "" 10
Outside a menu, this action
draws the shadow in the armed state and, if
\fBXmNfillOnArm\fP is set to True, fills the button with the color
specified by \fBXmNarmColor\fP\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
\fBXmNarmPixmap\fP is used for the button face\&.
This action calls the \fBXmNarmCallback\fP callbacks\&.
.IP "" 10
Outside a menu, this action also arranges for the following to happen,
either immediately or at a later time:
the shadow is drawn in the unarmed state and, if \fBXmNfillOnArm\fP is set
to True, the background color reverts to the unarmed color\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNlabelPixmap\fP is used for the button face\&.
The \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP callbacks are
called\&.
.IP "\fB<Key>\fP\fB<osfHelp>\fP:" 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\&.
This action 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<osfCancel>\fP:" 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\&.
For a PushButtonGadget outside of a menu, if the parent is a manger, this
action passes the event to the parent\&.
.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 PushButtonGadget is not in a menu and the cursor leaves and then
reenters the PushButtonGadget while the button is pressed, this
action draws the shadow in the armed state\&.
If \fBXmNfillOnArm\fP is set
to True, it also fills the button with the
color specified by \fBXmNarmColor\fP\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNarmPixmap\fP is used for the button face\&.
.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 PushButtonGadget is not in a menu and the cursor leaves the
PushButtonGadget while the button is pressed, this action draws the
shadow in the unarmed state\&.
If \fBXmNfillOnArm\fP is set to True, the background color reverts to
the unarmed color\&.
If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP,
the \fBXmNlabelPixmap\fP is used for the button face\&.
.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),
\fBXmCreatePushButtonGadget\fP(3),
\fBXmGadget\fP(3),
\fBXmLabelGadget\fP(3),
\fBXmRowColumn\fP(3),
\fBXmVaCreatePushButtonGadget\fP(3), and
\fBXmVaCreateManagedPushButtonGadget\fP(3)\&.