XtAppCreateShell(3)

πŸ’– XtAppCreateShell β€” the tea β˜•

okay bestie, so this is a page from the XT FUNCTIONS corner of the X Toolkit Intrinsics manual (libXt), and it's all about XtAppCreateShell and XtVaAppCreateShell β€” the two icons that ✨create top-level widget instances✨. Periodt.


🌸 NAME 🌸

XtAppCreateShell, XtVaAppCreateShell β€” create top-level widget instance 🫢


πŸŽ€ SYNTAX πŸŽ€

First thing, bestie, you gotta include the header:

#include <X11/Intrinsic.h>

Then the two queens themselves:

Widget XtAppCreateShell(const char *application_name, const char
       *application_class, WidgetClass widget_class, Display *display,
       ArgList args, Cardinal num_args);

Widget XtVaAppCreateShell(const char * application_name, const char *
       application_class, WidgetClass widget_class, Display *display,
       ...);

not the varargs one serving ... realness 😭 iconic behavior honestly


πŸ’… ARGUMENTS πŸ’…

Every single one, no skips, we don't gatekeep:

  • application_name β€” the name of the application instance. yes, literally just the name of this instance, your little guy's government name πŸ“
  • application_class β€” the class name of this application. it's usually the generic name covering every instance of the app, so like the family name while application_name is the first name, iykyk πŸ’œ
  • widget_class β€” the widget class that the application top-level widget should be. you pick it, it becomes it, main character energy πŸ‘‘
  • display β€” the display you're pulling resources from. gotta say where the vibes come from 🌈
  • args β€” the argument list you're getting resources from.
  • num_args β€” how many arguments are in that argument list. count them. fr fr πŸ”’
  • ... β€” the variable argument list you're getting resources from (this is the XtVa one's whole thing, so extra, so valid ✨)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the lore 🧚

XtAppCreateShell saves the application_name and application_class you handed it, and it does that so it can qualify all the widget resource specifiers. those two values become the left-most components in every widget resource name for this application. like, they're the prefix, the header, the first two bars of the song πŸ’–

and bestie, listen β€” XtAppCreateShell should be used to create a new logical application inside a program, or to create a shell on another display. two completely valid situations, both slay:

  • in the first case, it lets you specify a new root in the resource hierarchy. fresh tree, new beginnings 🌱
  • in the second case, it uses the resource database associated with the other display. it's not borrowing your display's drama, it's got its own πŸ’…
🫢 heads up: the widget returned by XtAppCreateShell has the WM_COMMAND property set for session managers (see Chapter 4). no cap, it's right there in the text.

⭐ SEE ALSO ⭐

go read these next, bestie, for the full cinematic universe:

  • XtCreateWidget(3)
  • X Toolkit Intrinsics - C Language Interface
  • Xlib - C Language X Interface

and that's the whole page πŸ’œ this was X Version 11, libXt 1.3.1 β€” consider yourself fully educated, now go create a shell and be the top-level widget you wish to see in the world πŸŽ€βœ¨ bye bestie!!

πŸ“¦ where this page comes from