XtClass(3)
π NAME π
XtClass, XtSuperclass, XtIsSubclass, XtCheckSubclass, XtIsObject, XtIsRectObj, XtIsWidget, XtIsComposite, XtIsConstraint, XtIsShell, XtIsOverrideShell, XtIsWMShell, XtIsVendorShell, XtIsTransientShell, XtIsTopLevelShell, XtIsApplicationShell, XtIsSessionShell β bestie, this is the whole girl-gang of functions that obtain and verify a widget's class. That's it, that's the job, and they ate. π
This is from the XT FUNCTIONS manual, section 3, in case you were wondering where we're at. β¨
πΈ SYNTAX πΈ
First you gotta pull in the header, no cap:
#include <X11/Intrinsic.h>
Then here's every single one of them, in order, exactly as written:
WidgetClass XtClass(Widget w);
WidgetClass XtSuperclass(Widget w);
Boolean XtIsSubclass(Widget w, WidgetClass widget_class);
void XtCheckSubclass(Widget widget, WidgetClass widget_class, String
message);
Boolean XtIsObject(Widget w);
Boolean XtIsRectObj(Widget w);
Boolean XtIsWidget(Widget w);
Boolean XtIsComposite(Widget w);
Boolean XtIsConstraint(Widget w);
Boolean XtIsShell(Widget w);
Boolean XtIsOverrideShell(Widget w);
Boolean XtIsWMShell(Widget w);
Boolean XtIsVendorShell(Widget w);
Boolean XtIsTransientShell(Widget w);
Boolean XtIsTopLevelShell(Widget w);
Boolean XtIsApplicationShell(Widget w);
Boolean XtIsSessionShell(Widget w);
Look at that lineup. Seventeen functions. Main character energy from top to bottom. π
π ARGUMENTS π
wβ Specifies the widget. (The one you're interrogating. Be nice to her. π₯Ί)widget_classβ Specifies the widget class. (The vibe you're comparing against. π)messageβ Specifies the message that is to be used. (The little note she'll scream at everyone if things go wrong. π)
β¨ DESCRIPTION β¨
Okay so let's go one by one, because each of these has her own little thing going on:
XtClassreturns a pointer to the widget's class structure. Straight to the point, no drama. π¦XtSuperclassreturns a pointer to the widget's superclass class structure. So like, her mom. Her lineage. Her origin story. π«XtIsSubclassreturnsTrueif the class of the specified widget is equal to or is a subclass of the specified class. And here's the tea: the widget's class can be any number of subclasses down the chain and does not need to be an immediate subclass of the specified class. Composite widgets that need to restrict the class of the items they contain can useXtIsSubclassto find out if a widget belongs to the desired class of objects. Obsessed with the flexibility ngl. πXtCheckSubclassis a macro, and she determines if the class of the specified widget is equal to or is a subclass of the specified widget class. Same deal: the widget can be any number of subclasses down the chain and need not be an immediate subclass of the specified widget class. BUT β and this is the part where it gets real β if the specified widget is not a subclass,XtCheckSubclassconstructs an error message from the suppliedmessage, the widget's actual class, and the expected class, and callsXtErrorMsg. π So yeah, she will absolutely read you in front of everyone.XtCheckSubclassshould be used at the entry point of exported routines to ensure that the client has passed in a valid widget class for the exported operation. Gatekeeping? Maybe. Correct? Also yes. π«Ά
π¨ Important caveat bestie, do not skip this one:XtCheckSubclassis only executed when the widget has been compiled with the compiler symbolDEBUGdefined; otherwise, it is defined as the empty string and generates no code. So in a non-DEBUGbuild she literally vanishes. Poof. No check. No message. Just vibes. π
- To test if a given widget belongs to a subclass of an Intrinsics-defined class, the Intrinsics defines macros or functions equivalent to
XtIsSubclassfor each of the built-in classes. Those procedures are:XtIsObject,XtIsRectObj,XtIsWidget,XtIsComposite,XtIsConstraint,XtIsShell,XtIsOverrideShell,XtIsWMShell,XtIsVendorShell,XtIsTransientShell,XtIsTopLevelShell,XtIsApplicationShell, andXtIsSessionShell. Thirteen little shortcuts so you don't have to spell out the whole class every time. Queen behavior. π - The
ngl the original page literally just ends there β "The" and then nothing π we are not making that up, that's genuinely how the manpage text stops. Left us on a cliffhanger fr fr.
π SEE ALSO π
XtAppErrorMsg(3)XtDisplay(3)- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language X Interface
That's the whole page, bestie, every flag, every class, every warning, not a single crumb left behind. π
Kisses from X Version 11, libXt 1.3.1 β mwah, go check your subclass, stay in DEBUG mode, 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