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

πŸ’– XmArrowButton(3) β€” the ArrowButton widget class πŸ’–

okay bestie, welcome to the XmArrowButton glow-up. this is a <library call> manpage from section 3, and it's literally just a lil directional arrow in a shadowed border. iconic behavior. let's get into it.


✨ NAME ✨

XmArrowButton β€” the ArrowButton widget class. that's her. that's the whole name.


🌸 SYNOPSIS 🌸

#include <Xm/ArrowB.h>

that's it. that's the whole vibe. one include and you're in.


πŸ¦‹ DESCRIPTION πŸ¦‹

so, ArrowButton is a directional arrow wrapped up in a border shadow. she's giving main character energy in a very small package.

when she gets selected, the shadow changes so it looks like the ArrowButton has been pressed in. no cap.

when she's unselected, the shadow flips back so she looks released, or out. push-pop, in-out, the whole journey. πŸ’…

also β€” and this is important β€” ArrowButton holds the XmQTactivatable trait. slay.

πŸ‘‘ Classes πŸ‘‘

ArrowButton inherits behavior, resources, and traits from the Core and XmPrimitive classes. she got it from her ancestors, periodt.

  • the class pointer is xmArrowButtonWidgetClass
  • the class name is XmArrowButton

πŸŽ€ New Resources πŸŽ€

okay so here's where the programmer gets to specify data. the programmer can also set the resource values for the inherited classes to set attributes for this widget, just so you know.

a couple of rules for the .Xdefaults girlies:

  • 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 β€” either lowercase or uppercase, doesn't matter, but include any underscores between words.

and the codes in the access column? they tell you what you can do with the resource:

  • C β€” can be set at creation time
  • S β€” can be set by using XtSetValues
  • G β€” can be retrieved by using XtGetValues
  • N/A β€” not applicable

here's the whole XmArrowButton Resource Set, laid out for you:

  • 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

and now the deets on each one, because you deserve the full lore:

  • XmNactivateCallback β€” specifies a list of callbacks that gets called when the ArrowButton is activated. to activate the button, press and release BSelect while the pointer is inside the ArrowButton widget. activating the ArrowButton 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 gets called when the ArrowButton is armed. to arm this widget, press BSelect while the pointer is inside the ArrowButton. 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
  • XmNdetailShadowThickness β€” specifies the thickness of the inside arrow shadows. the default thickness is 2 pixels.
  • XmNdisarmCallback β€” specifies a list of callbacks that gets called when the ArrowButton is disarmed. to disarm this widget, press and release BSelect while the pointer is inside the ArrowButton. the reason for this callback is XmCR_DISARM.
  • XmNmultiClick β€” okay listen up, this one's a little fiddly. 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 button is not in a menu, the default value is XmMULTICLICK_KEEP. 🫢
ngl XmNmultiClick defaults to dynamic up in the table and that's because the actual default depends on whether the button is in a menu β€” so don't @ me, that's just what the page says.

🌈 Inherited Resources 🌈

ArrowButton inherits behavior and resources from the superclasses described in the table that follows. for a complete description of each resource, refer to the reference page for that superclass. iykyk β€” the ancestors did the heavy lifting first.


and that's a wrap on part one, bestie. there's more coming, don't go anywhere πŸ’œ

✨ XmPrimitive Resource Set ✨

okay bestie, this is the big one β€” every resource that <Xm/Primitive.h> and friends hand you for free. Each line below gives you the resource Name, its Class, its Type, its Default, and its Access mode, exactly like the table in the original. No skips, no shortcuts. πŸ’–

  • XmNbottomShadowColor β€” Class XmCBottomShadowColor, type Pixel, default dynamic, access CSG.
  • XmNbottomShadowPixmap β€” Class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNconvertCallback β€” Class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNforeground β€” Class XmCForeground, type Pixel, default dynamic, access CSG.
  • XmNhelpCallback β€” Class XmCCallback, type XtCallbackList, default NULL, access C.
  • 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 XmCLayoutDirection, type XmDirection, default dynamic, access CG.
  • XmNnavigationType β€” Class XmCNavigationType, type XmNavigationType, default XmNONE, access CSG.
  • XmNpopupHandlerCallback β€” Class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNshadowThickness β€” Class XmCShadowThickness, type Dimension, default 2, 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.

quick vibe check on that Access column bestie β€” you're seeing CSG, C, and CG in there, and ngl the mix matters when you're setting things at create time vs. later. πŸ‘€ Note that XmNconvertCallback, XmNhelpCallback, and XmNpopupHandlerCallback are all the C girlies with a NULL default, while XmNlayoutDirection is the lone CG in the group β€” everyone else is CSG. 🌸

and yes, the dynamic defaults are literally dynamic β€” that's what the page says, so that's what you get. ✨

✨ Core Resource Set ✨

okay bestie, here's the full core resource lineup for XmArrowButton β€” every name, class, type, default and access mode, no skips πŸ’–

  • XmNaccelerators β€” class XmCAccelerators, type XtAccelerators, default dynamic, access CSG
  • XmNancestorSensitive β€” class XmCSensitive, type Boolean, default dynamic, access G
  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderColor β€” class XmCBorderColor, type Pixel, default XtDefaultForeground, access CSG
  • XmNborderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access CSG
  • XmNcolormap β€” class XmCColormap, type Colormap, default dynamic, access CG
  • XmNdepth β€” class XmCDepth, type int, default dynamic, access CG
  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG
  • XmNinitialResourcesPersistent β€” class XmCInitialResourcesPersistent, type Boolean, default True, access C
  • XmNmappedWhenManaged β€” class XmCMappedWhenManaged, type Boolean, default True, access CSG
  • XmNscreen β€” class XmCScreen, type Screen *, default dynamic, access CG
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, access CSG
  • XmNtranslations β€” class XmCTranslations, type XtTranslations, default dynamic, 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

🫢 Callback Information 🫢

so every callback gets handed a pointer to this lil struct, and it's giving very much:

typedef struct
{
        int reason;
        XEvent * event;
        int click_count;
} XmArrowButtonCallbackStruct;

and what the fields mean, bestie:

  • reason β€” tells you why the callback got invoked, periodt.
  • event β€” points to the XEvent that triggered the callback. the receipts, basically.
  • click_count β€” okay so this one is only valid when the reason is XmCR_ACTIVATE. it holds the number of clicks in the last multiclick sequence if the XmNmultiClick resource is set to XmMULTICLICK_KEEP; otherwise it just contains 1. and heads up β€” the activate callback fires for each click when XmNmultiClick is set to XmMULTICLICK_KEEP.

πŸŽ€ Translations πŸŽ€

XmArrowButton includes translations for XmPrimitive. the key names below are written in the X standard key event translation table syntax β€” that's the exact format Motif uses to map widget actions onto a given key πŸ”‘

there's a lil overview of the format over in VirtualBindings(3), and if you want the full breakdown, go read the X Toolkit Instrinsics Documentation. iykyk.

<EnterWindow>:
          Enter()

<LeaveWindow>:
          Leave()

c<Btn1Down>:
          ButtonTakeFocus()

∼c<Btn1Down>:
          Arm()

  • ∼c<Btn1Down>, ∼c<Btn1Up> β†’ Activate() Disarm()
  • ∼c<Btn1Down>(2+) β†’ MultiArm()
  • ∼c<Btn1Up>(2+) β†’ MultiActivate()
  • ∼c<Btn1Up> β†’ Activate() Disarm()
  • :<Key><osfActivate>: β†’ PrimitiveParentActivate()
  • :<Key><osfCancel>: β†’ PrimitiveParentCancel()
  • :<Key><osfSelect>: β†’ ArmAndActivate()
  • :<Key><osfHelp>: β†’ Help()
  • ∼s ∼m ∼a <Key>Return β†’ PrimitiveParentActivate()
  • ∼s ∼m ∼a <Key>space β†’ ArmAndActivate()

✨ ACTION ROUTINES ✨

okay bestie these are the actual action routines the ArrowButton ships with β€” the little moves it can pull when a translation fires it off πŸ’…

  • Activate() β€” draws the shadow in the unselected state. And if the pointer is within the ArrowButton, it calls the callbacks for XmNactivateCallback. that's it, that's the whole job 🫢
  • Arm() β€” draws the shadow in the selected state and calls the callbacks for XmNarmCallback. iconic behavior fr fr
  • ArmAndActivate() β€” draws the shadow in the selected state and calls the callbacks for XmNarmCallback. Then it arranges for the shadow to be drawn in the unselected state and the callbacks for XmNactivateCallback and XmNdisarmCallback to be called, either immediately or at a later time. yes it's doing the most, and yes it's serving πŸ’…
  • ButtonTakeFocus() β€” makes the ArrowButton take keyboard focus when Ctrl<Btn1Down> is pressed, without activating the widget. focus only, no drama, no activation, we respect the boundary πŸŽ€
  • Disarm() β€” draws the shadow in the unselected state and calls the callbacks for XmNdisarmCallback. we love a clean exit ✨
  • Help() β€” 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 goes up the family tree to find someone who can help, literally 😭🫢
  • MultiActivate() β€” If XmNmultiClick is XmMULTICLICK_DISCARD, 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 ArrowButton, this action calls the callbacks for XmNactivateCallback and XmNdisarmCallback. double duty, no cap πŸ‘‘
  • MultiArm() β€” If XmNmultiClick is XmMULTICLICK_DISCARD, this action does nothing. But if XmNmultiClick is XmMULTICLICK_KEEP, this action draws the shadow in the selected state and calls the callbacks for XmNarmCallback. simple, clean, slay 🌸

πŸ’– ADDITIONAL BEHAVIOR πŸ’–

bestie this widget also has some extra behavior going on, and it's giving main character energy:

  • <EnterWindow> β€” Draws the ArrowButton shadow in its selected state if the pointer leaves and re-enters the window while <Btn1> is pressed. she remembers where you were, she's keeping the vibe πŸ¦‹
  • <LeaveWindow> β€” Draws the ArrowButton shadow in its unselected state if the pointer leaves the window while <Btn1> is pressed. walking away = unselected, that's the rule periodt πŸ’…

🌈 VIRTUAL BINDINGS 🌈

ngl the bindings for virtual keys are vendor specific β€” so don't come for me, it's not universal, it's whoever built your thing. for the lowdown on bindings for virtual buttons and keys, go read VirtualBindings(3). iykyk πŸ“–βœ¨


the whole friend group, go say hi:


and that's a wrap on the whole thing, bestie πŸŽ€ this was the XmArrowButton(library call) page β€” the library-call flavor of the manual, brought to you by the fine folks who write X manuals, and yes you read all of it, we're so proud of you πŸ’– go forth and click responsibly πŸ‘‘