XMHIERARCHY(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 ✨

XmHierarchy β€” the Hierarchy widget class. It's a library call, bestie. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Xm/Hierarchy.h>

πŸ’– DESCRIPTION πŸ’–

The Hierarchy widget is not intended to be instantiated itself, but rather should be used as the base class for any widget that would like to present a hierarchy of information to the user that is different for the actual widget instance hierarchy of the application. This base class is currently used for two widgets in the Motif widget set, Tree and Outline, giving those two widgets a very similar API. πŸ‘‘

Note: The Hierarchy widget assumes that it will be totally responsible for mapping and unmapping its children. Therefore no child of this widget should ever modify its mappedWhenManaged resource. If a child does modify this resource the behavior is undefined. πŸ’€

πŸ‘‘ Classes πŸ‘‘

Hierarchy inherits behaviour, resources, and traits from Core, Composite, Composite, Constraint, and XmManager classes.

The class pointer is xmHierarchyWidgetClass.

The class name is XmHierarchy.


🌸 New Resources 🌸

Here's the resource set, with Name, Class, Type, Default, and Access. No cap, every single one is here. ✨

πŸŽ€ XmHierarchy Resource Set πŸŽ€

  • XmNautoClose β€” class XmCAutoClose, type Boolean, default True, access CSG. This resource determines if the hierarchy should automatically restore a parent node's children when the parent node is reopened. If autoClose is False, and the hierarchy is fully expanded when the root node is closed, then the entire hierarchy will be displayed as expanded when the root node is reopened. If autoClose is True, then the root node's children are closed when the root node is reopened. πŸ‘‘
  • XmNcloseFolderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG. This resource defines a pixmap for the closed representation of the folder pixmap to be used throughout the tree. It can be a color pixmap or bitmap. If the user does not specify a pixmap the default bitmap will be used. πŸŽ€
  • XmNhorizontalMargin β€” class XmCDimension, type Dimension, default 2, access CSG. The exact definition of these resources are left to the subclass of the hierarchy widget that does the geometry layout. They are intended to be used as the amount of space between the object and the edges of the window it is displayed in. They are included here for consistency. (Yes, same energy as XmNverticalMargin.) πŸ’…
  • XmNnodeStateCallback β€” class XmCNodeStateCallback, type XtCallbackList, default NULL, access C. The list of callback routines called when a folder button is clicked. See "Callback Routine" for more details. πŸ’–
  • XmNopenFolderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG. This resource defines a pixmap for the open representation of the folder pixmap to be used throughout the tree . It can be a color pixmap or bitmap. If the user does not specify a pixmap the default opened folder bitmap. πŸ¦‹
  • XmNrefigureMode β€” class XmCBoolean, type Boolean, default True, access CSG. This resource determines whether the Hierarchy should adjust the sizes of the children after a geometry or resize request, or simply ignore the request. This resource is very useful in improving the performance of an application that is making a large number of geometry changes all at once. πŸ”₯
  • XmNverticalMargin β€” class XmCDimension, type Dimension, default 2, access CSG. The exact definition of these resources are left to the subclass of the hierarchy widget that does the geometry layout. They are intended to be used as the amount of space between the object and the edges of the window it is displayed in. They are included here for consistency. (Same shared description as XmNhorizontalMargin.) 🌈

πŸ“ XmHierarchy Constraint Resource Set πŸ“

  • XmNinsertBefore β€” class XmCInsertbefore, type Widget, default NULL, access CSG. Specifies another node that has the same parentNode. This node will then be placed immediately before that node in the hierarchy. If this value is NULL then the node will be inserted at the end of the list. This resource allows the hierarchy's children to be reordered. 🌈
  • XmNnodeState β€” class XmCNodeState, type XMHierarchyNodeState, default XmOpen, access CSG. The state of this node. Acceptable values are: XmOpen, XmClosed, XmAlwaysOpen, and XmHidden. A type converter has been registered that can convert the following strings: "open", "close", "alwaysOpen", and "hidden". πŸ‘‘
  • XmNparentNode β€” class XmCParentNode, type Widget, default NULL, access CSG. The hierarchy parent of this node. The parent node MUST be a widget sibling of the current node. πŸ’€

🌟 Inherited Resources 🌟

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

✨ XmManager Resource Set ✨

bestie this is the motherlode πŸ’– every single one of these is a resource you can set on manager-type widgets, and here's the whole rundown β€” name, class, type, default and access, all of it, no skips:

  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG. the bottom shadow's color, bestie πŸ’…
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG. pixmap version of the bottom shadow, if you're feeling fancy πŸŽ€
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG. the foreground color, iconic as always ⭐
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. the callback that fires when help is requested 🫢
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG. the highlight color, for when something's gotta pop ✨
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG. the pixmap flavor of the highlight 🌸
  • XmNinitialFocus β€” class XmCInitialFocus, type Widget, default dynamic, access CSG. which widget gets the focus first, main character energy fr fr πŸ‘‘
  • XmNlayoutDirection β€” class XmCLayoutDirection, type XmDirection, default dynamic, access CG. which way the layout flows, bestie 🌈
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmTAB_GROUP, access CSG. how this widget plays into keyboard navigation πŸ’œ
  • XmNpopupHandlerCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. the callback for handling popups πŸ¦‹
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default dynamic, access CSG. how chunky the shadow is πŸ’…
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CG. which way strings read, no cap πŸŽ€
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG. top shadow color, the other half of the glow-up ✨
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG. top shadow, but as a pixmap 🌟
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default True, access CSG. can keyboard traversal land on this widget? default is yes, slay βœ…
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG. what units we're measuring in, iykyk πŸ“
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG. your own lil' pointer to stash whatever you want πŸ“

πŸŽ€ Composite Resource Set πŸŽ€

and now the Composite resource set β€” only three of them, lowkey the chillest table in the whole page, but every single one still matters:

  • XmNchildren β€” class XmCReadOnly, type WidgetList, default NULL, access G. the list of child widgets β€” read only bestie, hands off πŸ™ˆ
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default NULL, access CSG. the procedure that decides where new children slot in 🌈
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G. how many children there are β€” also read only, we just be looking πŸ‘€

quick reminder bestie: CSG means you can set it at creation, set it later, and read it. C means creation-time only. CG is create-or-get. G is get-only. πŸ’…

πŸŽ€ Core Resource Set πŸŽ€

Okay bestie, here's the whole resource lineup. Every row has five things: the Name (the resource you poke), its Class, its Type, its Default, and its Access code. I'm keeping every single one exactly as printed, no cap πŸ’…

  • XmNaccelerators β€” class XmCAccelerators, type XtAccelerators, default dynamic, access N/A
  • 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

That's the whole set, all nineteen, nothing skipped, we ate πŸ“


✨ Callback Information ✨

So when a folder gets clicked πŸ‘†, the routines you registered on the XmNnodeStateCallback list get handed a pointer to this struct as client data:

typedef struct _XmHierarchyNodeStateData {
     Widget widget;
     XmHierarchyNodeState state;
} XmHierarchyNodeStateData;
  • widget β€” the child node of Hierarchy that's being opened or closed πŸ¦‹
  • state β€” the current XmNnodeState of that node, like, after the click. The legal values are XmOpen, XmClosed, XmAlwaysOpen, and XmHidden. Periodt.

🌸 Children 🌸

The hierarchy keeps IconButtons for every single node in the hierarchy, bestie. If you wanna set openFolderPixmap or closeFolderPixmap, you do it through XtSetValues. And lowkey important: those IconButtons may only be manipulated by the Hierarchy itself πŸ™ˆ. Hands off, okay?



okay that's genuinely the whole page, we made it to the end together 🫢 this whole thing is XmHierarchy, a library call, and that's a wrap bestie β€” go forth and build your little collapsible tree iconically πŸ‘‘πŸ’–βœ¨