XMARROWBUTTONGADGET(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

πŸ’– XmArrowButtonGadget β€” the ArrowButtonGadget widget class πŸ’–

okay so bestie, welcome to XmArrowButtonGadget(library call) β€” yes that's the manual page name, yes it's a mouthful, we're gonna get through it together 🫢


✨ NAME ✨

XmArrowButtonGadget β€” literally The ArrowButtonGadget widget class. that's it. that's the name. iconic behavior honestly πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <Xm/ArrowBG.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

so picture this: an ArrowButtonGadget is a directional arrow, right, and it's surrounded by a border shadow. that's the whole vibe. 🌈

when it gets selected, the shadow changes so it looks like the ArrowButtonGadget has been pressed in. when it's unselected, the shadow reverts and it looks like the button is released, or out. the glow-up and the glow-down, basically. πŸ’…

ArrowButtonGadget holds the XmQTactivatable trait. noted. important. don't forget it.


πŸ‘― Classes

ArrowButtonGadget inherits behavior, resources, and traits from the Object, RectObj, and XmGadget classes. it's giving nepo baby but make it inheritance hierarchy, and honestly? slay.

  • The class pointer is xmArrowButtonGadgetClass.
  • The class name is XmArrowButtonGadget.

⭐ New Resources ⭐

okay so the following table defines a set of widget resources used by the programmer to specify data. (yes i said table, we're doing it as a list because terminal, bear with me, all the info is here fr fr.)

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).

🌸 XmArrowButtonGadget Resource Set 🌸

  • XmNactivateCallback β€” Class: XmCCallback Β· Type: XtCallbackList Β· Default: NULL Β· Access: C
  • XmNarmCallback β€” Class: XmCCallback Β· Type: XtCallbackList Β· Default: NULL Β· Access: C
  • XmNarrowDirection β€” Class: XmCArrowDirection Β· Type: unsigned char Β· Default: XmARROW_UP Β· Access: CSG
  • XmNdetailShadowThickness β€” Class: XmCDetailShadowThickness Β· Type: Dimension Β· Default: 2 Β· Access: CSG
  • XmNdisarmCallback β€” Class: XmCCallback Β· Type: XtCallbackList Β· Default: NULL Β· Access: C
  • XmNmultiClick β€” Class: XmCMultiClick Β· Type: unsigned char Β· Default: dynamic Β· Access: CSG

πŸ’– XmNactivateCallback

specifies a list of callbacks that is called when the ArrowButtonGadget is activated. to activate the button, press and release BSelect while the pointer is inside the ArrowButtonGadget. activating the ArrowButtonGadget also disarms it. the reason sent by this callback is XmCR_ACTIVATE. this callback uses the XmQTactivatable trait. πŸ’«

πŸ’œ XmNarmCallback

specifies a list of callbacks that is called when the ArrowButtonGadget is armed. to arm this widget, press BSelect while the pointer is inside the ArrowButtonGadget. the reason sent by this callback is XmCR_ARM.

πŸ”₯ XmNarrowDirection

sets the arrow direction. the values for this resource are

  • XmARROW_UP
  • XmARROW_DOWN
  • XmARROW_LEFT
  • XmARROW_RIGHT

pick your fighter. πŸ‘‘

πŸ“ XmNdetailShadowThickness

specifies the thickness of the inside arrow shadows. the default thickness is 2 pixels. tiny but mighty.

πŸ™ˆ XmNdisarmCallback

specifies a list of callbacks that is called when the ArrowButtonGadget is disarmed. to disarm this widget, press and release BSelect while the pointer is inside the ArrowButtonGadget. the reason sent by this callback is XmCR_DISARM.

🌈 XmNmultiClick

okay so 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 XmMULTICLICK_DISCARD, the second click is not processed. if this resource is set to XmMULTICLICK_KEEP, the event is processed and click_count is incremented in the callback structure. when the ArrowButtonGadget is not in a menu, the default value is XmMULTICLICK_KEEP.

no cap: XmMULTICLICK_DISCARD means that second click just gets ghosted πŸ’€ the event does not go through. choose wisely.

🧚 Inherited Resources 🧚

XmArrowButtonGadget 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. (iykyk β€” the tables live on in the pages for those superclasses, go read those bestie, they're the whole lore) πŸ’œ


πŸ’– XmGadget Resource Set πŸ’–

okay bestie, before we even get to the arrow-button-specific stuff, every gadget inherits a whole mountain of resources from its ancestors. here's the XmGadget set β€” all of it, no skipping, no cap:

  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG. the canvas behind everything 🎨
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG. wallpaper instead of a flat colour ✨
  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG. the bottom shadow's whole vibe πŸ’…
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default dynamic, access CSG. same energy, but as a pixmap πŸ¦‹
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. your help-me callback 🫢
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG. the ink, the front colour, the moment πŸ–‹οΈ
  • 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. and yes, the class is spelled exactly like that, type it character for character, don't get creative 😭
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmNONE, access CSG
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default 2, access CSG
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG. top shadow, but make it colour 🌈
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG. top shadow, but make it a pixmap 🌸
  • 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. your personal lil stash, put whatever you want in there πŸ“

πŸŽ€ RectObj Resource Set πŸŽ€

and underneath that there's the RectObj set β€” the geometry girlies. every one of these, coming right up πŸ‘‘

  • 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

lowkey obsessed with how tidy that list is πŸ’œ and we are so not done yet β€”

okay so last chunk of the resource table, and it is tiny β€” literally one entry, we love a low-effort slay πŸ’…

Object Resource Set

  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. That's it, that's the whole set, bestie πŸŽ€

🌸 Callback Information 🌸

Every callback gets handed a pointer to this exact lil struct, no cap:

typedef struct
{
        int reason;
        XEvent * event;
        int click_count;
} XmArrowButtonCallbackStruct;
  • reason β€” spills the tea on why the callback got invoked in the first place.
  • event β€” points at the XEvent that triggered the whole thing.
  • click_count β€” heads up, this one only means anything when reason is XmCR_ACTIVATE. It holds the number of clicks in the last multiclick sequence if XmNmultiClick is set to XmMULTICLICK_KEEP β€” otherwise it's just 1. And lowkey important: if XmNmultiClick is XmMULTICLICK_KEEP, the activate callback fires for every single click, not just once.

πŸ¦‹ Behavior πŸ¦‹

XmArrowButtonGadget inherits its whole vibe from XmGadget, obviously. But here's the extra stuff it does on its own:

  • <Btn1Down> β€” draws the shadow in the selected state and calls the callbacks for XmNarmCallback. It's giving "I'm armed and ready" energy 😀
  • <Btn1Down> or <Btn1Up> β€” draws the shadow in the unselected state. If the pointer is within the ArrowButtonGadget, it calls the callbacks for XmNactivateCallback. Also calls the callbacks for XmNdisarmCallback.
  • <Btn1Down>(2+) β€” if XmNmultiClick is XmMULTICLICK_DISCARD, this action does absolutely nothing, fr. If XmNmultiClick is XmMULTICLICK_KEEP, it draws the shadow in the selected state and calls the callbacks for XmNarmCallback.
  • <Btn1Up>(2+) β€” if XmNmultiClick is XmMULTICLICK_DISCARD, again, this action does nothing. If XmNmultiClick is XmMULTICLICK_KEEP, this action increments click_count in the callback structure and draws the shadow in the unselected state. And if the pointer is within the ArrowButtonGadget, it calls the callbacks for XmNactivateCallback and XmNdisarmCallback.
  • <Key><osfSelect> β€” draws the shadow in the selected state and calls the callbacks for XmNarmCallback. It also arranges for the shadow to be drawn in the unselected state, plus the callbacks for XmNactivateCallback and XmNdisarmCallback to get called β€” either immediately or at a later time. whenever it feels like it, iconic behavior ✨
  • <Key><osfHelp> β€” calls the callbacks for XmNhelpCallback if any exist. If there are no help callbacks for this widget, this action goes and calls the help callbacks for the nearest ancestor that has them. passing the aux cord up the family tree 🫢
  • <Enter> β€” draws the ArrowButtonGadget shadow in its selected state if the pointer leaves and re-enters the gadget while <Btn1> is pressed.
  • <Leave> β€” draws the ArrowButtonGadget shadow in its unselected state if the pointer leaves the gadget while <Btn1> is pressed.

🧚 Virtual Bindings 🧚

The bindings for virtual keys are vendor specific β€” so it's a "your mileage may vary, ask your vendor" situation, ngl. For information about bindings for virtual buttons and keys, see VirtualBindings(3).


The squad, the crew, the whole friend group πŸ’œ


and that's a wrap on XmArrowButtonGadget(library call) β€” straight out of the library-call corner of the Motif man pages, with its date and version living down at the bottom of the page. go forth and arrow-button, bestie, you ate πŸ’…πŸŽ€βœ¨