XMTOGGLEBUTTONGADGET(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ 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: C
  • XmNdetailShadowThickness β€” class: XmCDetailShadowThickness Β· type: Dimension Β· default: 2 Β· access: CSG
  • XmNdisarmCallback β€” class: XmCDisarmCallback Β· type: XtCallbackList Β· default: NULL Β· access: C
  • XmNfillOnSelect β€” class: XmCFillOnSelect Β· type: Boolean Β· default: dynamic Β· access: CSG
  • XmNindeterminatePixmap β€” class: XmCIndeterminatePixmap Β· type: Pixmap Β· default: XmUNSPECIFIED_PIXMAP Β· access: CSG
  • XmNindicatorOn β€” class: XmCIndicatorOn Β· type: unsigned char Β· default: XmINDICATOR_FILL Β· access: CSG
  • XmNindicatorSize β€” class: XmCIndicatorSize Β· type: Dimension Β· default: dynamic Β· access: CSG
  • XmNindicatorType β€” class: XmCIndicatorType Β· type: unsigned char Β· default: dynamic Β· access: CSG
  • XmNselectColor β€” class: XmCSelectColor Β· type: Pixel Β· default: dynamic Β· access: CSG
  • XmNselectInsensitivePixmap β€” class: XmCSelectInsensitivePixmap Β· type: Pixmap Β· default: XmUNSPECIFIED_PIXMAP Β· access: CSG
  • XmNselectPixmap β€” class: XmCSelectPixmap Β· type: Pixmap Β· default: XmUNSPECIFIED_PIXMAP Β· access: CSG
  • XmNset β€” class: XmCSet Β· type: unsigned char Β· default: XmUNSET Β· access: CSG
  • XmNspacing β€” class: XmCSpacing Β· type: Dimension Β· default: 4 Β· access: CSG
  • XmNtoggleMode β€” class: XmCToggleMode Β· type: unsigned char Β· default: XmTOGGLE_BOOLEAN Β· access: CSG
  • XmNunselectColor β€” class: XmCUnselectColor Β· type: Pixel Β· default: dynamic Β· access: CSG
  • XmNvalueChangedCallback β€” class: XmCValueChangedCallback Β· type: XtCallbackList Β· default: NULL Β· access: C
  • XmNvisibleWhenOff β€” 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's XmNlayoutDirection resource. Default vibe is XmINDICATOR_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 the XmDisplay XmNenableToggleVisual resource is True, the visuals are the ones from XmINDICATOR_CHECK_BOX; if it's False, the indicator visuals are the ones from XmINDICATOR_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 the XmDisplay XmNenableToggleVisual resource 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 for XmNindicatorSize, 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 resources XmNmarginTop, XmNmarginBottom, and XmNmarginLeft. πŸ¦‹
  • XmNindicatorType β€” says whether the indicator is a 1-of or an N-of indicator. For the 1-of indicator, the value can be XmONE_OF_MANY, XmONE_OF_MANY_ROUND, or XmONE_OF_MANY_DIAMOND. For the N-of indicator, the value is XmN_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 is XmONE_OF_MANY; otherwise the default is XmN_OF_MANY. Legal values are:
    • XmONE_OF_MANY β€” when the Display XmNenableToggleVisual resource is set, indicators are drawn looking the same as XmONE_OF_MANY_ROUND; otherwise they appear the same as XmONE_OF_MANY_DIAMOND.
    • XmN_OF_MANY β€” the indicators are drawn as specified by the XmNindicatorOn resource.
    • 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 resource XmNenableToggleColor. A value of True causes the fill color to use the XmHIGHLIGHT_COLOR color by default. A value of False causes 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 to XmNselectColor when XmNindicatorOn is XmINDICATOR_NONE, you have to explicitly set XmNfillOnSelect to True. 🌸

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 resource XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING. If the ToggleButtonGadget is unselected and the button is insensitive, the pixmap in XmNlabelInsensitivePixmap gets used as the button face instead. And if no value is specified for XmNlabelInsensitivePixmap, that resource is set to whatever you gave XmNselectInsensitivePixmap. ✨
  • XmNselectPixmap β€” specifies the pixmap to be used as the button face if XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING, and the ToggleButtonGadget is selected. When the ToggleButtonGadget is unselected, the pixmap specified in LabelGadget's XmNlabelPixmap is used. If no value is specified for XmNlabelPixmap, that resource gets set to whatever you gave XmNselectPixmap.
  • XmNset β€” represents the state of the ToggleButton, bestie. XmUNSET means the ToggleButton is not set. XmSET means it is set. XmINDETERMINATE means it's in an indeterminate state β€” neither set nor unset, it's giving liminal space. πŸ’€ The ToggleButton states cycle through in the order XmSET, XmINDETERMINATE (if XmNtoggleMode is set to XmTOGGLE_INDETERMINATE), and XmUNSET, then back around to XmSET. If XmNtoggleMode is set to XmTOGGLE_BOOLEAN, the states cycle through XmSET, then XmUNSET, then back around to XmSET. 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 either XmTOGGLE_BOOLEAN or XmTOGGLE_INDETERMINATE. The XmTOGGLE_INDETERMINATE value lets the XmNset resource accept the values XmINDETERMINATE, XmSET, and XmUNSET. The XmNtoggleMode resource gets forced to XmTOGGLE_BOOLEAN if the toggle is in an XmRowColumn widget whose radio behavior is XmONE_OF_MANY. And in XmTOGGLE_BOOLEAN mode, the XmNset resource can only accept XmSET and XmUNSET. 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 is XmNbackground. For a monochrome display, the default is set to the background color. To set the background of the button to XmNunselectColor when XmNindicatorOn is XmINDICATOR_NONE, you must explicitly set XmNfillOnSelect to True. This resource acts like XmNselectColor, but for the case when XmNset is XmUNSET. 🫢
  • 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 is XmCR_VALUE_CHANGED. πŸ“£
  • XmNvisibleWhenOff β€” 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.

🌈 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 β€” class XmCAccelerator, type String, default NULL, access CSG
  • XmNacceleratorText β€” class XmCAcceleratorText, type XmString, default NULL, access CSG
  • XmNalignment β€” class XmCAlignment, type unsigned char, default dynamic, access CSG
  • XmNfontList β€” class XmCFontList, type XmFontList, default dynamic, access CSG
  • XmNlabelInsensitivePixmap β€” class XmCLabelInsensitivePixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNlabelPixmap β€” class XmCLabelPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNlabelString β€” class XmCXmString, type XmString, default dynamic, access CSG
  • XmNlabelType β€” class XmCLabelType, type unsigned char, default XmSTRING, access CSG
  • XmNmarginBottom β€” class XmCMarginBottom, type Dimension, default dynamic, access CSG
  • XmNmarginHeight β€” class XmCMarginHeight, type Dimension, default 2, access CSG
  • XmNmarginLeft β€” class XmCMarginLeft, type Dimension, default dynamic, access CSG
  • XmNmarginRight β€” class XmCMarginRight, type Dimension, default 0, access CSG
  • XmNmarginTop β€” class XmCMarginTop, type Dimension, default dynamic, access CSG
  • XmNmarginWidth β€” class XmCMarginWidth, type Dimension, default 2, access CSG
  • XmNmnemonic β€” class XmCMnemonic, type KeySym, default NULL, access CSG
  • XmNmnemonicCharSet β€” class XmCMnemonicCharSet, type String, default dynamic, access CSG
  • XmNpixmapPlacement β€” class XmCPixmapPlacement, type unsigned int, default XmPIXMAP_LEFT, access CSG
  • XmNpixmapTextPadding β€” class XmCSpace, type Dimension, default 2, access CSG
  • XmNrecomputeSize β€” class XmCRecomputeSize, type Boolean, default True, access CSG
  • XmNrenderTable β€” class XmCRenderTable, type XmRenderTable, default dynamic, access CSG
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CSG

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 β€” class XmCBackground Β· type Pixel Β· default: dynamic Β· access: CSG
  • XmNbackgroundPixmap β€” class XmCPixmap Β· type Pixmap Β· default: XmUNSPECIFIED_PIXMAP Β· access: CSG
  • XmNbottomShadowColor β€” class XmCBottomShadowColor Β· type Pixel Β· default: dynamic Β· access: CSG
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap Β· type Pixmap Β· default: dynamic Β· access: CSG
  • XmNhelpCallback β€” class XmCCallback Β· type XtCallbackList Β· default: NULL Β· access: C
  • XmNforeground β€” class XmCForeground Β· type Pixel Β· default: dynamic Β· access: CSG
  • XmNhighlightColor β€” class XmCHighlightColor Β· type Pixel Β· default: dynamic Β· access: CSG
  • XmNhighlightOnEnter β€” class XmCHighlightOnEnter Β· type Boolean Β· default: False Β· access: CSG
  • XmNhighlightPixmap β€” class XmCHighlightPixmap Β· type Pixmap Β· default: dynamic Β· access: CSG
  • XmNhighlightThickness β€” class XmCHighlightThickness Β· type Dimension Β· default: 2 Β· access: CSG
  • XmNlayoutDirection β€” class XmNCLayoutDirection Β· type XmDirection Β· default: dynamic Β· access: CG
  • XmNnavigationType β€” class XmCNavigationType Β· type XmNavigationType Β· default: XmNONE Β· access: CSG
  • XmNshadowThickness β€” class XmCShadowThickness Β· type Dimension Β· default: dynamic Β· access: CSG
  • XmNtopShadowColor β€” class XmCTopShadowColor Β· type Pixel Β· default: dynamic Β· access: CSG
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap Β· type Pixmap Β· default: dynamic Β· access: CSG
  • XmNtraversalOn β€” class XmCTraversalOn Β· type Boolean Β· default: True Β· access: CSG
  • XmNunitType β€” class XmCUnitType Β· type unsigned char Β· default: dynamic Β· access: CSG
  • XmNuserData β€” class XmCUserData Β· type XtPointer Β· 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 β€” class XmCSensitive Β· type Boolean Β· default: dynamic Β· access: G
  • XmNborderWidth β€” class XmCBorderWidth Β· type Dimension Β· default: 0 Β· access: N/A
  • XmNheight β€” class XmCHeight Β· type Dimension Β· default: dynamic Β· access: CSG
  • XmNsensitive β€” class XmCSensitive Β· type Boolean Β· default: True Β· access: CSG
  • XmNwidth β€” class XmCWidth Β· type Dimension Β· default: dynamic Β· access: CSG
  • XmNx β€” class XmCPosition Β· type Position Β· default: 0 Β· access: CSG
  • XmNy β€” class XmCPosition Β· type Position Β· 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 β€” class XmCCallback, type XtCallbackList, default NULL, access C. 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 the XEvent that triggered the whole situation.
  • set β€” reflects the ToggleButtonGadget's state, and it's one of exactly three vibes: XmSET (selected), XmUNSET (unselected), or XmINDETERMINATE (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 changes set from XmUNSET to XmSET prior to calling the callback. So by the time your callback peeks at set, 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 XmNarmCallback callbacks.
    • Outside a menu, if the button was previously unset: if XmNindicatorOn is True, it draws the indicator shadow so the indicator looks pressed; if XmNfillOnSelect is True, it fills the indicator with the color specified by XmNselectColor. If XmNindicatorOn is False, it draws the button shadow so the button looks pressed. If XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING, the XmNselectPixmap is used as the button face. And this resource calls the XmNarmCallback callbacks.
    • Outside a menu, if the button was previously set: if both XmNindicatorOn and XmNvisibleWhenOff are True, it draws the indicator shadow so the indicator looks raised; if XmNfillOnSelect is True, it fills the indicator with the background color. If XmNindicatorOn is False, it draws the button shadow so the button looks raised. If XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING, the XmNlabelPixmap is used as the button face. And this resource calls the XmNarmCallback callbacks.
  • <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 the XmNvalueChangedCallback callbacks and then the XmNdisarmCallback callbacks.
    • 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 XmNvalueChangedCallback callbacks.
    • If the button is outside a menu, this action calls the XmNdisarmCallback callbacks.
  • <Key><osfHelp> β€” In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy and, when the shell's keyboard focus policy is XmEXPLICIT, restores keyboard focus to the widget that had the focus before the menu system was entered. Calls the callbacks for XmNhelpCallback if 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 the XmNarmCallback callbacks; and calls the XmNvalueChangedCallback and XmNdisarmCallback callbacks. 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, the XmNvalueChangedCallback, and XmNdisarmCallback callbacks.
    • Outside a menu, if the button was previously unset: if XmNindicatorOn is True, it draws the indicator shadow so the indicator looks pressed; if XmNfillOnSelect is True, it fills the indicator with the color specified by XmNselectColor. If XmNindicatorOn is False, it draws the button shadow so the button looks pressed. If XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING, the XmNselectPixmap is used as the button face. This action calls the XmNarmCallback, XmNvalueChangedCallback, XmNdisarmCallback callbacks.
    • Outside a menu, if the button was previously set: if both XmNindicatorOn and XmNvisibleWhenOff are True, it draws the indicator shadow so the indicator looks raised; if XmNfillOnSelect is True, it fills the indicator with the background color. If XmNindicatorOn is False, it draws the button shadow so the button looks raised. If XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING, the XmNlabelPixmap is used as the button face. Calls the XmNarmCallback, XmNvalueChangedCallback, and XmNdisarmCallback callbacks.
  • <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 is XmEXPLICIT, 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 the XmNarmCallback callbacks.
    • 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 the XmNdisarmCallback callbacks.
    • 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). πŸ“–


The whole fam, all together, no cap:


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 βœ¨πŸ¦‹πŸ’–