XtGetResourceList(3)
π XtGetResourceList β the XT FUNCTIONS girlies π
okay so bestie, welcome to the XtGetResourceList(3) page, part of the XT FUNCTIONS era of the X Toolkit Intrinsics. two functions, one vibe: they hand you back a whole resource list. let's get into it π«Ά
β¨ NAME β¨
XtGetResourceList, XtGetConstraintResourceList β obtain resource list. that's it, that's the job, and they ate π
β¨ SYNTAX β¨
#include <X11/Intrinsic.h>
void XtGetResourceList(WidgetClass class, XtResourceList
*resources_return, Cardinal *num_resources_return);
void XtGetConstraintResourceList(WidgetClass class, XtResourceList
*resources_return, Cardinal *num_resources_return);
yep, twin functions, literally identical signatures, the only glow-up difference is in the name. iconic behavior β¨
β¨ ARGUMENTS β¨
num_resources_returnβ a pointer to where you want the number of entries in the resource list to get stored. she's the counter girlie πresources_returnβ a pointer to where the returned resource list gets stored. major caveat bestie: the caller must free this storage usingXtFreewhen they're done with it. do not ghost it, do not forget it, free your memory π§widget_classβ the widget class you want the list for. specify your girl π
β¨ DESCRIPTION β¨
okay so here's the tea on XtGetResourceList β
if you call XtGetResourceList before the widget class is initialized (and by "initialized" we mean before the first widget of that class has even been created β yeah, timing matters), then XtGetResourceList returns the resource list as specified in the widget class record. plain, unmerged, straight from the source πΈ
but if you call it after the widget class has been initialized? then XtGetResourceList returns a merged resource list that contains the resources for all superclasses. the whole family tree showed up to the function call π«
the list returned byXtGetResourceListshould be freed usingXtFreewhen it is no longer needed. free. your. list. no cap. π
now for the constraint twin, XtGetConstraintResourceList π
if XtGetConstraintResourceList is called before the widget class is initialized (again: before the first widget of that class has been created), it returns the resource list as specified in the widget class Constraint part record. constraint-coded π
if it's called after the widget class has been initialized, XtGetConstraintResourceList returns a merged resource list that contains the Constraint resources for all superclasses. the constraint ancestors all pulled up π§¬
and here's the plot twist: if the specified class is not a subclass of constraintWidgetClass, then *resources_return is set to NULL and *num_resources_return is set to zero. not a constraint class? no list for you, bestie, the function said "not my problem" π
and yeah, the list returned byXtGetConstraintResourceListshould also be freed usingXtFreewhen it is no longer needed. both of them. every time. that's the rule π
β¨ SEE ALSO β¨
XtGetSubresources(3)XtOffset(3)- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language X Interface
and that's the whole page, bestie!! you now know how to obtain a resource list, both the regular kind and the constraint kind, and you know to XtFree that storage when you're done, which is honestly the most main character thing you can do for your memory management β¨
this page lives in X Version 11, libXt 1.3.1, and the manual it came from is the XT FUNCTIONS manual β so go forth, call your functions, free your lists, and slay π ππ
π¦ where this page comes from
- alpine 3.22: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.23: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.24: libxt-doc 1.3.1-r0 Β· MIT
- arch rolling: libxt 1.3.1-1 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- Copyright 1993 X Consortium
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms