XMHIERARCHY(3)
β¨ 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β classXmCAutoClose, typeBoolean, defaultTrue, accessCSG. This resource determines if the hierarchy should automatically restore a parent node's children when the parent node is reopened. IfautoCloseisFalse, 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. IfautoCloseisTrue, then the root node's children are closed when the root node is reopened. πXmNcloseFolderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG. 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β classXmCDimension, typeDimension, default2, accessCSG. 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 asXmNverticalMargin.) πXmNnodeStateCallbackβ classXmCNodeStateCallback, typeXtCallbackList, defaultNULL, accessC. The list of callback routines called when a folder button is clicked. See "Callback Routine" for more details. πXmNopenFolderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG. 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β classXmCBoolean, typeBoolean, defaultTrue, accessCSG. 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β classXmCDimension, typeDimension, default2, accessCSG. 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 asXmNhorizontalMargin.) π
π XmHierarchy Constraint Resource Set π
XmNinsertBeforeβ classXmCInsertbefore, typeWidget, defaultNULL, accessCSG. Specifies another node that has the sameparentNode. This node will then be placed immediately before that node in the hierarchy. If this value isNULLthen the node will be inserted at the end of the list. This resource allows the hierarchy's children to be reordered. πXmNnodeStateβ classXmCNodeState, typeXMHierarchyNodeState, defaultXmOpen, accessCSG. The state of this node. Acceptable values are:XmOpen,XmClosed,XmAlwaysOpen, andXmHidden. A type converter has been registered that can convert the following strings:"open","close","alwaysOpen", and"hidden". πXmNparentNodeβ classXmCParentNode, typeWidget, defaultNULL, accessCSG. 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β classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSG. the bottom shadow's color, bestie πXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG. pixmap version of the bottom shadow, if you're feeling fancy πXmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSG. the foreground color, iconic as always βXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. the callback that fires when help is requested π«ΆXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSG. the highlight color, for when something's gotta pop β¨XmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSG. the pixmap flavor of the highlight πΈXmNinitialFocusβ classXmCInitialFocus, typeWidget, defaultdynamic, accessCSG. which widget gets the focus first, main character energy fr fr πXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCG. which way the layout flows, bestie πXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSG. how this widget plays into keyboard navigation πXmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. the callback for handling popups π¦XmNshadowThicknessβ classXmCShadowThickness, typeDimension, defaultdynamic, accessCSG. how chunky the shadow is πXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCG. which way strings read, no cap πXmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSG. top shadow color, the other half of the glow-up β¨XmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSG. top shadow, but as a pixmap πXmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSG. can keyboard traversal land on this widget? default is yes, slay βXmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSG. what units we're measuring in, iykyk πXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG. 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β classXmCReadOnly, typeWidgetList, defaultNULL, accessG. the list of child widgets β read only bestie, hands off πXmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSG. the procedure that decides where new children slot in πXmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessG. how many children there are β also read only, we just be looking π
quick reminder bestie:CSGmeans you can set it at creation, set it later, and read it.Cmeans creation-time only.CGis create-or-get.Gis 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β classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessN/AXmNancestorSensitiveβ 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
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 currentXmNnodeStateof that node, like, after the click. The legal values areXmOpen,XmClosed,XmAlwaysOpen, andXmHidden. 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?
π RELATED π
Composite(3)Constraint(3)Core(3)XmCreateHierarchy(3)XmHierarchyGetChildNodes(3)XmHierarchyOpenAllAncestors(3)XmManager(3)
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 ππβ¨
π¦ 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