XMARROWBUTTON(3)
π 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
.Xdefaultsfile, remove theXmNorXmCprefix and use the remaining letters. - to specify one of the defined values for a resource in a
.Xdefaultsfile, remove theXmprefix 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 timeSβ can be set by usingXtSetValuesGβ can be retrieved by usingXtGetValuesN/Aβ not applicable
here's the whole XmArrowButton Resource Set, laid out for you:
XmNactivateCallbackβ ClassXmCCallback, TypeXtCallbackList, DefaultNULL, AccessCXmNarmCallbackβ ClassXmCCallback, TypeXtCallbackList, DefaultNULL, AccessCXmNarrowDirectionβ ClassXmCArrowDirection, Typeunsigned char, DefaultXmARROW_UP, AccessCSGXmNdetailShadowThicknessβ ClassXmCDetailShadowThickness, TypeDimension, Default2, AccessCSGXmNdisarmCallbackβ ClassXmCCallback, TypeXtCallbackList, DefaultNULL, AccessCXmNmultiClickβ ClassXmCMultiClick, Typeunsigned char, Defaultdynamic, AccessCSG
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 releaseBSelectwhile the pointer is inside the ArrowButton widget. activating the ArrowButton also disarms it. the reason sent by this callback isXmCR_ACTIVATE. this callback uses theXmQTactivatabletrait. πXmNarmCallbackβ specifies a list of callbacks that gets called when the ArrowButton is armed. to arm this widget, pressBSelectwhile the pointer is inside the ArrowButton. the reason sent by this callback isXmCR_ARM.XmNarrowDirectionβ sets the arrow direction. the values for this resource are:XmARROW_UPXmARROW_DOWNXmARROW_LEFTXmARROW_RIGHT
XmNdetailShadowThicknessβ specifies the thickness of the inside arrow shadows. the default thickness is2pixels.XmNdisarmCallbackβ specifies a list of callbacks that gets called when the ArrowButton is disarmed. to disarm this widget, press and releaseBSelectwhile the pointer is inside the ArrowButton. the reason for this callback isXmCR_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 toXmMULTICLICK_DISCARD, the second click is not processed. if this resource is set toXmMULTICLICK_KEEP, the event is processed andclick_countis incremented in the callback structure. when the button is not in a menu, the default value isXmMULTICLICK_KEEP. π«Ά
nglXmNmultiClickdefaults todynamicup 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β ClassXmCBottomShadowColor, typePixel, defaultdynamic, accessCSG.XmNbottomShadowPixmapβ ClassXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNconvertCallbackβ ClassXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNforegroundβ ClassXmCForeground, typePixel, defaultdynamic, accessCSG.XmNhelpCallbackβ ClassXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNhighlightColorβ ClassXmCHighlightColor, typePixel, defaultdynamic, accessCSG.XmNhighlightOnEnterβ ClassXmCHighlightOnEnter, typeBoolean, defaultFalse, accessCSG.XmNhighlightPixmapβ ClassXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSG.XmNhighlightThicknessβ ClassXmCHighlightThickness, typeDimension, default2, accessCSG.XmNlayoutDirectionβ ClassXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCG.XmNnavigationTypeβ ClassXmCNavigationType, typeXmNavigationType, defaultXmNONE, accessCSG.XmNpopupHandlerCallbackβ ClassXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNshadowThicknessβ ClassXmCShadowThickness, typeDimension, default2, accessCSG.XmNtopShadowColorβ ClassXmCTopShadowColor, typePixel, defaultdynamic, accessCSG.XmNtopShadowPixmapβ ClassXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSG.XmNtraversalOnβ ClassXmCTraversalOn, typeBoolean, defaultTrue, accessCSG.XmNunitTypeβ ClassXmCUnitType, typeunsigned char, defaultdynamic, accessCSG.XmNuserDataβ ClassXmCUserData, typeXtPointer, defaultNULL, accessCSG.
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β classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSGXmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGXmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSGXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSGXmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSGXmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCGXmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCGXmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSGXmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCXmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSGXmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCGXmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSGXmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSG
π«Ά 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 theXEventthat triggered the callback. the receipts, basically.click_countβ okay so this one is only valid when thereasonisXmCR_ACTIVATE. it holds the number of clicks in the last multiclick sequence if theXmNmultiClickresource is set toXmMULTICLICK_KEEP; otherwise it just contains1. and heads up β the activate callback fires for each click whenXmNmultiClickis set toXmMULTICLICK_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 forXmNactivateCallback. that's it, that's the whole job π«ΆArm()β draws the shadow in the selected state and calls the callbacks forXmNarmCallback. iconic behavior fr frArmAndActivate()β draws the shadow in the selected state and calls the callbacks forXmNarmCallback. Then it arranges for the shadow to be drawn in the unselected state and the callbacks forXmNactivateCallbackandXmNdisarmCallbackto 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 whenCtrl<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 forXmNdisarmCallback. we love a clean exit β¨Help()β 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 goes up the family tree to find someone who can help, literally ππ«ΆMultiActivate()β IfXmNmultiClickisXmMULTICLICK_DISCARD, this action does nothing.- If
XmNmultiClickisXmMULTICLICK_KEEP, this action incrementsclick_countin the callback structure and draws the shadow in the unselected state. And if the pointer is within the ArrowButton, this action calls the callbacks forXmNactivateCallbackandXmNdisarmCallback. double duty, no cap π
- If
MultiArm()β IfXmNmultiClickisXmMULTICLICK_DISCARD, this action does nothing. But ifXmNmultiClickisXmMULTICLICK_KEEP, this action draws the shadow in the selected state and calls the callbacks forXmNarmCallback. 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 πβ¨
π«Ά RELATED π«Ά
the whole friend group, go say hi:
Core(3)XmCreateArrowButton(3)XmPrimitive(3)XmVaCreateArrowButton(3)XmVaCreateManagedArrowButton(3)
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 π
π¦ 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