XtGetSubresources(3)

πŸ’– XtGetSubresources(3) β€” XT FUNCTIONS πŸ’–

okay bestie, gather round, because we're doing subresources today and honestly? it's giving ✨organized✨. this is part of the X Toolkit Intrinsics crew, and it's here to fetch subresources for you, no cap.


🌸 NAME 🌸

XtGetSubresources, XtVaGetSubresources β€” obtain subresources 🫢


✨ SYNTAX ✨

#include <X11/Intrinsic.h>

void XtGetSubresources(Widget w, XtPointer base, const char *name, const
       char * class, XtResourceList resources, Cardinal num_resources,
       ArgList args, Cardinal num_args);

void XtVaGetSubresources(Widget w, XtPointer base, const char *name,
       const char *class, XtResourceList resources, Cardinal
       num_resources, ...);

πŸŽ€ ARGUMENTS πŸŽ€

  • args β€” the argument list that overrides whatever resources came out of the resource database. it's the "actually, no, use this" list πŸ’…
  • base β€” the base address of the subpart data structure, aka where the resources get written. this is the drop-off spot, bestie πŸ“
  • class β€” the class of the subpart.
  • name β€” the name of the subpart.
  • num_args β€” how many arguments are in that argument list.
  • num_resources β€” how many resources are in the resource list.
  • resources β€” the resource list for the subpart.
  • w β€” the widget that wants resources for a subpart, or that identifies the resource database to search πŸ‘‘
  • ... β€” the variable arguments that override resources obtained from the resource database.

πŸ’œ DESCRIPTION πŸ’œ

so XtGetSubresources builds a name/class list, right? it constructs it from the application name/class, then the name/classes of all its ancestors, and then the widget itself. iconic lineage behavior fr fr 🌈

then it appends the name/class pair you passed in to that list. and then β€” the main character moment β€” the resources are fetched from the argument list, the resource database, or the default values in the resource list. after that they get copied into the subpart record. that's the whole glow-up πŸ¦‹

⚠️ one little thing, no cap: if args is NULL, then num_args must be zero. but flip side β€” if num_args is zero, the argument list is not referenced at all. so like... it's fine, it's just not looking at it πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • XtGetApplicationResources, XtVaGetApplicationResources
  • X Toolkit Intrinsics - C Language Interface
  • Xlib - C Language X Interface

and that's the page, bestie!! this one's from X Version 11, libXt 1.3.1, and it's the XtGetSubresources(3) page β€” so if you ever forget, just remember: subresources obtained, vibes immaculate, periodt πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from