XMTOGGLEBUTTONGADGET(3)
β¨ NAME β¨
okay bestie, this is the manual for XmToggleButtonGadget (library call) β The ToggleButtonGadget widget class. no cap, it's literally the whole vibe. π
π¦ SYNOPSIS π¦
Before you can even use this gadget, you gotta include the right header, like:
#include <Xm/ToggleBG.h>
π DESCRIPTION π
So ToggleButtonGadget sets nontransitory state data inside an application. Usually this gadget is giving an indicator (square, diamond, or round) with either text or a pixmap on one side of it. But it can also be just text or just a pixmap, no indicator at all. periodt. β¨
The toggle graphics display a 1-of-many, N-of-many, or N-of-many-round selection state. When a toggle indicator is displayed, a square indicator shows an N-of-many selection state, a diamond-shaped indicator shows a 1-of-many selection state, and a circle-shaped indicator shows a 1-of-many-round selection state. slay. π
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. π (not scary, just dramatic)
The default behavior associated with a ToggleButtonGadget in a menu depends on the type of menu system in which it resides. By default, <Btn1> controls the behavior of the ToggleButtonGadget. In addition, <Btn3> controls the behavior of the ToggleButtonGadget if it resides in a PopupMenu system. The actual mouse button used is determined by its RowColumn parent. iykyk. π
Label's resource XmNmarginLeft may be increased to accommodate the toggle indicator when it is created. πΈ
ToggleButtonGadget uses the XmQTmenuSystem and XmQTspecifyRenderTable traits. π
π Classes π
ToggleButtonGadget inherits behavior, resources, and traits from Object, RectObj, XmGadget and XmLabelGadget. it's giving inheritance, bestie.
The class pointer is xmToggleButtonGadgetClass.
The class name is XmToggleButtonGadget.
π New Resources π
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 .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm 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 XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A). β¨
ok so this is the whole resource set for XmToggleButtonGadget β name, class, type, default, and access, all of it, nothing skipped, we love a complete table π (it's not a table here because tables are illegal in this house, but you get it):
XmNarmCallbackβ class:XmCArmCallbackΒ· type:XtCallbackListΒ· default:NULLΒ· access:CXmNdetailShadowThicknessβ class:XmCDetailShadowThicknessΒ· type:DimensionΒ· default:2Β· access:CSGXmNdisarmCallbackβ class:XmCDisarmCallbackΒ· type:XtCallbackListΒ· default:NULLΒ· access:CXmNfillOnSelectβ class:XmCFillOnSelectΒ· type:BooleanΒ· default: dynamic Β· access:CSGXmNindeterminatePixmapβ class:XmCIndeterminatePixmapΒ· type:PixmapΒ· default:XmUNSPECIFIED_PIXMAPΒ· access:CSGXmNindicatorOnβ class:XmCIndicatorOnΒ· type:unsigned charΒ· default:XmINDICATOR_FILLΒ· access:CSGXmNindicatorSizeβ class:XmCIndicatorSizeΒ· type:DimensionΒ· default: dynamic Β· access:CSGXmNindicatorTypeβ class:XmCIndicatorTypeΒ· type:unsigned charΒ· default: dynamic Β· access:CSGXmNselectColorβ class:XmCSelectColorΒ· type:PixelΒ· default: dynamic Β· access:CSGXmNselectInsensitivePixmapβ class:XmCSelectInsensitivePixmapΒ· type:PixmapΒ· default:XmUNSPECIFIED_PIXMAPΒ· access:CSGXmNselectPixmapβ class:XmCSelectPixmapΒ· type:PixmapΒ· default:XmUNSPECIFIED_PIXMAPΒ· access:CSGXmNsetβ class:XmCSetΒ· type:unsigned charΒ· default:XmUNSETΒ· access:CSGXmNspacingβ class:XmCSpacingΒ· type:DimensionΒ· default:4Β· access:CSGXmNtoggleModeβ class:XmCToggleModeΒ· type:unsigned charΒ· default:XmTOGGLE_BOOLEANΒ· access:CSGXmNunselectColorβ class:XmCUnselectColorΒ· type:PixelΒ· default: dynamic Β· access:CSGXmNvalueChangedCallbackβ class:XmCValueChangedCallbackΒ· type:XtCallbackListΒ· default:NULLΒ· access:CXmNvisibleWhenOffβ class:XmCVisibleWhenOffΒ· type:BooleanΒ· default: dynamic Β· access:CSG
and now the tea on each one, bestie β
XmNarmCallback
hands you a list of callbacks that fires the moment the ToggleButtonGadget gets armed. how do you arm it? press the active mouse button while the pointer is chillin' inside the ToggleButtonGadget. that's it, that's the move π«Ά for this callback, the reason is XmCR_ARM.
XmNdetailShadowThickness
sets how thick the indicator shadow is. default is 2 pixels, no notes, periodt.
XmNdisarmCallback
a list of callbacks that fires when the ToggleButtonGadget gets disarmed. to disarm, press and release the active mouse button while the pointer is inside the ToggleButtonGadget. and lowkey the gadget also disarms when the user moves out of the gadget and releases the mouse button while the pointer is outside the gadget. for this callback, the reason is XmCR_DISARM.
XmNfillOnSelect
ok this one's the main character β¨ when it's set to True, it fills the indicator with the color from XmNselectColor and switches the top and bottom shadow colors. if it's unset, it fills the indicator with the unselect color. if it's indeterminate, it 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 (like a check box) is specified, or if XmNindicatorType is a 1-of type and a toggle indicator is drawn. and if XmNfillOnSelect is True, XmNset is XmSET, and XmNindicatorOn is XmINDICATOR_NONE, the ToggleButtonGadget's background is set to XmNselectColor. for the other XmNindicatorOn values, only the indicator gets filled with XmNselectColor. ikyk π
XmNindeterminateInsensitivePixmap
picks the pixmap shown as the button face when the Label XmNlableType resource is XmPIXMAP or XmPIXMAP_AND_STRING, the ToggleButtonGadget XmNset resource is XmINDETERMINATE, and the Core XmNsensitive resource is False. that's the whole vibe check π¦
XmNindeterminatePixmap
basically the twin of the last one π it picks the pixmap shown as the button face when the Label XmNlableType resource is XmPIXMAP or XmPIXMAP_AND_STRING, the ToggleButtonGadget XmNset resource is XmINDETERMINATE, and the Core XmNsensitive resource is True.
XmNindicatorOnβ okay so if a toggle indicator is even getting drawn at all, this says it gets drawn on one side of the toggle text or pixmap, and which side depends on the widget'sXmNlayoutDirectionresource. Default vibe isXmINDICATOR_FILL. Toggles accept these values:XmINDICATOR_NONEβ literally no space is set aside for the indicator and it's not shown, periodt. Any shadows around the entire widget get switched when the toggle is selected or unselected.XmINDICATOR_BOXβ the indicator is a shadowed box, that's the whole look.XmINDICATOR_FILLβ if theXmDisplayXmNenableToggleVisualresource isTrue, the visuals are the ones fromXmINDICATOR_CHECK_BOX; if it'sFalse, the indicator visuals are the ones fromXmINDICATOR_BOX.XmINDICATOR_CHECKβ the indicator is a checkmark, drawn in the foreground color.XmINDICATOR_CHECK_BOXβ the indicator is a checkmark inside a box. This is the default when theXmDisplayXmNenableToggleVisualresource is set.XmINDICATOR_CROSS_BOXβ the indicator is a cross inside a box.XmINDICATOR_CROSSβ the indicator is just a cross.
All ToggleButton checks and crosses should be drawn in the foreground color, jsyk.
If this resource is not XmINDICATOR_NONE, it controls the appearance of the toggle visual. If XmNset is XmINDETERMINATE and XmNindicatorOn is not XmINDICATOR_NONE, this resource shows a stippled flat box. And if XmNset is XmINDETERMINATE, XmNindicatorOn is XmINDICATOR_NONE, and XmNtoggleMode is XmTOGGLE_INDETERMINATE, then the label and the ToggleButton are stippled with a combination of the XmNselectColor and the XmNunselectColor color, and the border is flat. π
XmNindicatorSizeβ sets the size of the indicator. If you don't give it a value, the indicator's size is based on the size of the label string or pixmap. And if the label string or pixmap changes, the indicator size gets recomputed off the label string or pixmap's size. But once you do specify a value forXmNindicatorSize, the indicator keeps that size no matter what the label string or pixmap does, until you specify a new value. Heads up: indicators inside menus might be a different size than the ones outside menus. Also note that changing this resource can also change the values of the inherited resourcesXmNmarginTop,XmNmarginBottom, andXmNmarginLeft. π¦XmNindicatorTypeβ says whether the indicator is a 1-of or an N-of indicator. For the 1-of indicator, the value can beXmONE_OF_MANY,XmONE_OF_MANY_ROUND, orXmONE_OF_MANY_DIAMOND. For the N-of indicator, the value isXmN_OF_MANY. Important: this value only specifies the visuals and does not enforce the behavior. When the ToggleButton is in a radio box, the default isXmONE_OF_MANY; otherwise the default isXmN_OF_MANY. Legal values are:XmONE_OF_MANYβ when the DisplayXmNenableToggleVisualresource is set, indicators are drawn looking the same asXmONE_OF_MANY_ROUND; otherwise they appear the same asXmONE_OF_MANY_DIAMOND.XmN_OF_MANYβ the indicators are drawn as specified by theXmNindicatorOnresource.XmONE_OF_MANY_ROUNDβ a shadowed circle.XmONE_OF_MANY_DIAMONDβ a shadowed diamond.
XmNselectColorβ lets the app specify what color fills the center of the square, diamond-shaped, or round indicator when it's set. If this color matches 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's filled completely. The results of this resource depend on the value of the Display resourceXmNenableToggleColor. A value ofTruecauses the fill color to use theXmHIGHLIGHT_COLORcolor by default. A value ofFalsecauses the fill color to use the background color. 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 to set the background of the button toXmNselectColorwhenXmNindicatorOnisXmINDICATOR_NONE, you have to explicitly setXmNfillOnSelecttoTrue. πΈ
This resource can take these values:
XmDEFAULT_SELECT_COLORβ same as the current dynamic default, which is a color between the background and the bottom shadow color.XmREVERSED_GROUND_COLORSβ forces the select color to the foreground color and makes the default color of any text rendered over the select color be the background color.XmHIGHLIGHT_COLORβ forces the fill color to use the highlight color.
XmNselectInsensitivePixmapβ specifies a pixmap used as the button face when the ToggleButtonGadget is selected, the button is insensitive, and the LabelGadget resourceXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING. If the ToggleButtonGadget is unselected and the button is insensitive, the pixmap inXmNlabelInsensitivePixmapgets used as the button face instead. And if no value is specified forXmNlabelInsensitivePixmap, that resource is set to whatever you gaveXmNselectInsensitivePixmap. β¨XmNselectPixmapβ specifies the pixmap to be used as the button face ifXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING, and the ToggleButtonGadget is selected. When the ToggleButtonGadget is unselected, the pixmap specified in LabelGadget'sXmNlabelPixmapis used. If no value is specified forXmNlabelPixmap, that resource gets set to whatever you gaveXmNselectPixmap.XmNsetβ represents the state of the ToggleButton, bestie.XmUNSETmeans the ToggleButton is not set.XmSETmeans it is set.XmINDETERMINATEmeans it's in an indeterminate state β neither set nor unset, it's giving liminal space. π The ToggleButton states cycle through in the orderXmSET,XmINDETERMINATE(ifXmNtoggleModeis set toXmTOGGLE_INDETERMINATE), andXmUNSET, then back around toXmSET. IfXmNtoggleModeis set toXmTOGGLE_BOOLEAN, the states cycle throughXmSET, thenXmUNSET, then back around toXmSET. Setting this resource sets the state of the ToggleButton.XmNspacingβ specifies the amount of spacing between the toggle indicator and the toggle label (text or pixmap).XmNtoggleModeβ specifies the mode of the ToggleButtonGadget as eitherXmTOGGLE_BOOLEANorXmTOGGLE_INDETERMINATE. TheXmTOGGLE_INDETERMINATEvalue lets theXmNsetresource accept the valuesXmINDETERMINATE,XmSET, andXmUNSET. TheXmNtoggleModeresource gets forced toXmTOGGLE_BOOLEANif the toggle is in anXmRowColumnwidget whose radio behavior isXmONE_OF_MANY. And inXmTOGGLE_BOOLEANmode, theXmNsetresource can only acceptXmSETandXmUNSET. No indeterminate shenanigans allowed, nope. πXmNunselectColorβ lets the app specify what color fills the center of the square, diamond-shaped, or round indicator when it's not set. Same rule as before: if this color matches 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's filled completely. The default for a color display isXmNbackground. For a monochrome display, the default is set to the background color. To set the background of the button toXmNunselectColorwhenXmNindicatorOnisXmINDICATOR_NONE, you must explicitly setXmNfillOnSelecttoTrue. This resource acts likeXmNselectColor, but for the case whenXmNsetisXmUNSET. π«ΆXmNvalueChangedCallbackβ 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. That action also causes the gadget to be disarmed. For this callback, the reason isXmCR_VALUE_CHANGED. π£XmNvisibleWhenOffβ indicates that the toggle indicator is visible in the unselected state when the Boolean value isTrue. When the ToggleButtonGadget is in a menu, the default value isFalse. When the ToggleButtonGadget is in a RadioBox, the default value isTrue.
π Inherited Resources π
ToggleButtonGadget inherits behavior and resources from the superclasses described in the following tables. For a complete description of each resource, go look at the reference page for that superclass. iykyk, they got the receipts. π
πΈ XmLabelGadget Resource Set πΈ
Okay bestie, here's the whole lineup β every single resource that comes with the XmLabelGadget set. Same order as always: Name, Class, Type, Default, Access. No skipping, no summarizing, we're doing all of them. π
XmNacceleratorβ classXmCAccelerator, typeString, defaultNULL, accessCSGXmNacceleratorTextβ classXmCAcceleratorText, typeXmString, defaultNULL, accessCSGXmNalignmentβ classXmCAlignment, typeunsigned char, defaultdynamic, accessCSGXmNfontListβ classXmCFontList, typeXmFontList, defaultdynamic, accessCSGXmNlabelInsensitivePixmapβ classXmCLabelInsensitivePixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNlabelPixmapβ classXmCLabelPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNlabelStringβ classXmCXmString, typeXmString, defaultdynamic, accessCSGXmNlabelTypeβ classXmCLabelType, typeunsigned char, defaultXmSTRING, accessCSGXmNmarginBottomβ classXmCMarginBottom, typeDimension, defaultdynamic, accessCSGXmNmarginHeightβ classXmCMarginHeight, typeDimension, default2, accessCSGXmNmarginLeftβ classXmCMarginLeft, typeDimension, defaultdynamic, accessCSGXmNmarginRightβ classXmCMarginRight, typeDimension, default0, accessCSGXmNmarginTopβ classXmCMarginTop, typeDimension, defaultdynamic, accessCSGXmNmarginWidthβ classXmCMarginWidth, typeDimension, default2, accessCSGXmNmnemonicβ classXmCMnemonic, typeKeySym, defaultNULL, accessCSGXmNmnemonicCharSetβ classXmCMnemonicCharSet, typeString, defaultdynamic, accessCSGXmNpixmapPlacementβ classXmCPixmapPlacement, typeunsigned int, defaultXmPIXMAP_LEFT, accessCSGXmNpixmapTextPaddingβ classXmCSpace, typeDimension, default2, accessCSGXmNrecomputeSizeβ classXmCRecomputeSize, typeBoolean, defaultTrue, accessCSGXmNrenderTableβ classXmCRenderTable, typeXmRenderTable, defaultdynamic, accessCSGXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCSG
Not the dynamic defaults doing the most in literally every other row π β they get figured out at runtime instead of being locked in from the jump, and that's just the vibe here. And <yellow>CSG</yellow> on every single one, no cap: it means these are set at creation, gettable, and settable, all day. π«Ά
Also clock the XmNlabelInsensitivePixmap and XmNlabelPixmap defaults β both XmUNSPECIFIED_PIXMAP, which is the "bestie I have not chosen one yet" of pixmap values. π
That's the full XmLabelGadget resource set, every row, zero skipped. β¨
β¨ XmGadget Resource Set β¨
okay so before we get to the toggle-button-specific stuff, bestie, you gotta meet the gadget family β everything a gadget inherits just for existing π«Ά. Every row here is Name β Class β Type β Default β Access, and I am handing you all of them, no skips, no crumbs left behind π
XmNbackgroundβ classXmCBackgroundΒ· typePixelΒ· default:dynamicΒ· access:CSGXmNbackgroundPixmapβ classXmCPixmapΒ· typePixmapΒ· default:XmUNSPECIFIED_PIXMAPΒ· access:CSGXmNbottomShadowColorβ classXmCBottomShadowColorΒ· typePixelΒ· default:dynamicΒ· access:CSGXmNbottomShadowPixmapβ classXmCBottomShadowPixmapΒ· typePixmapΒ· default:dynamicΒ· access:CSGXmNhelpCallbackβ classXmCCallbackΒ· typeXtCallbackListΒ· default:NULLΒ· access:CXmNforegroundβ classXmCForegroundΒ· typePixelΒ· default:dynamicΒ· access:CSGXmNhighlightColorβ classXmCHighlightColorΒ· typePixelΒ· default:dynamicΒ· access:CSGXmNhighlightOnEnterβ classXmCHighlightOnEnterΒ· typeBooleanΒ· default:FalseΒ· access:CSGXmNhighlightPixmapβ classXmCHighlightPixmapΒ· typePixmapΒ· default:dynamicΒ· access:CSGXmNhighlightThicknessβ classXmCHighlightThicknessΒ· typeDimensionΒ· default:2Β· access:CSGXmNlayoutDirectionβ classXmNCLayoutDirectionΒ· typeXmDirectionΒ· default:dynamicΒ· access:CGXmNnavigationTypeβ classXmCNavigationTypeΒ· typeXmNavigationTypeΒ· default:XmNONEΒ· access:CSGXmNshadowThicknessβ classXmCShadowThicknessΒ· typeDimensionΒ· default:dynamicΒ· access:CSGXmNtopShadowColorβ classXmCTopShadowColorΒ· typePixelΒ· default:dynamicΒ· access:CSGXmNtopShadowPixmapβ classXmCTopShadowPixmapΒ· typePixmapΒ· default:dynamicΒ· access:CSGXmNtraversalOnβ classXmCTraversalOnΒ· typeBooleanΒ· default:TrueΒ· access:CSGXmNunitTypeβ classXmCUnitTypeΒ· typeunsigned charΒ· default:dynamicΒ· access:CSGXmNuserDataβ classXmCUserDataΒ· typeXtPointerΒ· default:NULLΒ· access:CSG
heads up bestie π«Ά the access codes up there are exactly what the page says βCSG,C,CGβ don't come for me, I'm just the messenger π
πΈ RectObj Resource Set πΈ
and underneath all of that, every gadget is still a RectObj, so it's also carrying this whole lil set of geometry-and-sensitivity res π§ these are the bones, the shape of the thing:
XmNancestorSensitiveβ classXmCSensitiveΒ· typeBooleanΒ· default:dynamicΒ· access:GXmNborderWidthβ classXmCBorderWidthΒ· typeDimensionΒ· default:0Β· access:N/AXmNheightβ classXmCHeightΒ· typeDimensionΒ· default:dynamicΒ· access:CSGXmNsensitiveβ classXmCSensitiveΒ· typeBooleanΒ· default:TrueΒ· access:CSGXmNwidthβ classXmCWidthΒ· typeDimensionΒ· default:dynamicΒ· access:CSGXmNxβ classXmCPositionΒ· typePositionΒ· default:0Β· access:CSGXmNyβ classXmCPositionΒ· typePositionΒ· default:0Β· access:CSG
so like. that's two whole resource sets just chillin in your inheritance chain before you even touch a toggle button π and bestie we are not done yetβ¦
XmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. That's it, that's the whole object resource set. One single resource. Minimalist icon behavior honestly π
π Callback Information π
When a callback fires, it gets handed a pointer to this lil struct right here:
typedef struct
{
int reason;
XEvent * event;
int set;
} XmToggleButtonCallbackStruct;
And here's what's inside it, bestie:
reasonβ spills the tea on why the callback got invoked in the first place.eventβ points at theXEventthat triggered the whole situation.setβ reflects the ToggleButtonGadget's state, and it's one of exactly three vibes:XmSET(selected),XmUNSET(unselected), orXmINDETERMINATE(neither, it's in its mysterious era β¨).
okay IMPORTANT, don't skip this: the state reported here is the state the ToggleButtonGadget is in after the event has been processed. Not before. After. So like β say a user clicks a ToggleButtonGadget to flip it from unselected to selected. In that case the ToggleButtonGadget changessetfromXmUNSETtoXmSETprior to calling the callback. So by the time your callback peeks atset, the glow-up already happened. π¦
πΈ Behavior πΈ
XmToggleButtonGadget includes behavior from XmGadget. It also includes menu traversal behavior from XmLabelGadget. And all the extra ToggleButtonGadget behavior? Listed below, babe:
<Btn2Down>β Drags the contents of a ToggleButtonGadget label, identified when<Btn2>is pressed. Heads up though: this action is undefined for ToggleButtonGadgets used in a menu system. π<Btn1Down>β okay so this one has layers:- In a menu: 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
XmNarmCallbackcallbacks. - Outside a menu, if the button was previously unset: if
XmNindicatorOnis True, it draws the indicator shadow so the indicator looks pressed; ifXmNfillOnSelectis True, it fills the indicator with the color specified byXmNselectColor. IfXmNindicatorOnis False, it draws the button shadow so the button looks pressed. IfXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING, theXmNselectPixmapis used as the button face. And this resource calls theXmNarmCallbackcallbacks. - Outside a menu, if the button was previously set: if both
XmNindicatorOnandXmNvisibleWhenOffare True, it draws the indicator shadow so the indicator looks raised; ifXmNfillOnSelectis True, it fills the indicator with the background color. IfXmNindicatorOnis False, it draws the button shadow so the button looks raised. IfXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING, theXmNlabelPixmapis used as the button face. And this resource calls theXmNarmCallbackcallbacks.
- In a menu: 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
<Btn1Up>β In a menu, this action unposts all menus in the menu hierarchy. If the ToggleButtonGadget was previously set, it unsets it; if it was previously unset, it sets it. Then it calls theXmNvalueChangedCallbackcallbacks and then theXmNdisarmCallbackcallbacks.- If the button is outside a menu and the pointer is within the button: if it was previously unset, sets it; if it was previously set, unsets it. This action calls the
XmNvalueChangedCallbackcallbacks. - If the button is outside a menu, this action calls the
XmNdisarmCallbackcallbacks.
- If the button is outside a menu and the pointer is within the button: if it was previously unset, sets it; if it was previously set, unsets it. This action calls the
<Key><osfHelp>β In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy and, when the shell's keyboard focus policy isXmEXPLICIT, restores keyboard focus to the widget that had the focus before the menu system was entered. Calls the callbacks forXmNhelpCallbackif any exist. And if there are no help callbacks for this widget? This action calls the help callbacks for the nearest ancestor that has them. It's giving "ask your mom, she'll know" energy fr fr π<Key><osfActivate>β In a menu, this action unposts all menus in the menu hierarchy. Unless the button is already armed, this action calls theXmNarmCallbackcallbacks; and calls theXmNvalueChangedCallbackandXmNdisarmCallbackcallbacks. Outside a menu, if the parent is a manager, this action passes the event to the parent.<Key><osfSelect>β If the ToggleButtonGadget was previously set, this action unsets it; if it was previously unset, this action sets it.- In a menu: unposts all menus in the menu hierarchy. Unless the button is already armed, this action calls the
XmNarmCallback, theXmNvalueChangedCallback, andXmNdisarmCallbackcallbacks. - Outside a menu, if the button was previously unset: if
XmNindicatorOnis True, it draws the indicator shadow so the indicator looks pressed; ifXmNfillOnSelectis True, it fills the indicator with the color specified byXmNselectColor. IfXmNindicatorOnis False, it draws the button shadow so the button looks pressed. IfXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING, theXmNselectPixmapis used as the button face. This action calls theXmNarmCallback,XmNvalueChangedCallback,XmNdisarmCallbackcallbacks. - Outside a menu, if the button was previously set: if both
XmNindicatorOnandXmNvisibleWhenOffare True, it draws the indicator shadow so the indicator looks raised; ifXmNfillOnSelectis True, it fills the indicator with the background color. IfXmNindicatorOnis False, it draws the button shadow so the button looks raised. IfXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING, theXmNlabelPixmapis used as the button face. Calls theXmNarmCallback,XmNvalueChangedCallback, andXmNdisarmCallbackcallbacks.
- In a menu: unposts all menus in the menu hierarchy. Unless the button is already armed, this action calls the
<Key><osfCancel>β 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 isXmEXPLICIT, 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.- In a Popup MenuPane, this action unposts the menu and restores keyboard focus to the widget from which the menu was posted.
<Enter>β In a menu, if keyboard traversal is enabled, this action does nothing. Otherwise, it draws the shadow in the armed state and calls theXmNarmCallbackcallbacks.- 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.
<Leave>β In a menu, if keyboard traversal is enabled, this action does nothing. Otherwise, it draws the shadow in the unarmed state and calls theXmNdisarmCallbackcallbacks.- 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.
π§ Virtual Bindings π§
The bindings for virtual keys are vendor specific β so like, don't @ your friend's setup and expect yours to match, okay? For info about bindings for virtual buttons and keys, go read VirtualBindings(3). π
π RELATED π
The whole fam, all together, no cap:
Object(3)RectObj(3)XmCreateRadioBox(3)XmCreateToggleButtonGadget(3)XmGadget(3)XmLabelGadget(3)XmRowColumn(3)XmToggleButtonGadgetGetState(3)XmToggleButtonGadgetSetState(3)XmVaCreateToggleButtonGadget(3)- and
XmVaCreateManagedToggleButtonGadget(3)
and that's the whole page bestie, you ate that π
This little love letter lives in the XmToggleButtonGadget(library call) corner of the manual β Motif library-call documentation, straight from the source. Go forth and toggle responsibly, periodt β¨π¦π
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms