XtAppErrorMsg(3)
π XtAppErrorMsg(3) β the XT FUNCTIONS girlies π
okay bestie, sit down, hydrate, because today we're talking about high-level error handlers from libXt. yes THAT libXt. the one that's been holding X Toolkit apps together since before either of us was born. she's iconic, she's dramatic, and she does NOT return (more on that in a sec π«£).
This whole page lives in the XT FUNCTIONS section of the manual, and it's covering four little besties: XtAppErrorMsg, XtAppSetErrorMsgHandler, XtAppSetWarningMsgHandler, and XtAppWarningMsg.
β¨ NAME β¨
XtAppErrorMsg, XtAppSetErrorMsgHandler, XtAppSetWarningMsgHandler, XtAppWarningMsg β high-level error handlers, no cap π
πΈ SYNTAX πΈ
#include <X11/Intrinsic.h>
_X_NORETURN void XtAppErrorMsg(XtAppContext app_context, const char
*name, const char *type, const char *class, const char
*defaultMsg, String *params, Cardinal *num_params);
XtErrorMsgHandler XtAppSetErrorMsgHandler(XtAppContext app_context,
_X_NORETURN XtErrorMsgHandler msg_handler);
XtErrorMsgHandler XtAppSetWarningMsgHandler(XtAppContext app_context,
XtErrorMsgHandler msg_handler);
void XtAppWarningMsg(XtAppContext app_context, const char *name, const
char *type, const char *class, const char *defaultMsg, String
*params, Cardinal *num_params);
notice the _X_NORETURN on two of them?? that's not a vibe, that's a warning. those functions literally do not come back. they're the friend who says "brb" and moves to another country. π
π ARGUMENTS π
app_contextβ specifies the application context. every one of these girlies needs to know which app she's working with. it's giving "who's your manager".classβ specifies the resource class of the error message. the category, the genre, the aesthetic of the error.defaultMsgβ specifies the default message to use. the fallback text, the backup outfit if the main one doesn't hit.nameβ specifies the general kind of error. the broad vibe. the "family" of the error.typeβ specifies the detailed name of the error. the specific vibe. the exact flavour.msg_handlerβ specifies the new fatal error procedure, which should not return or the nonfatal error procedure, which usually returns. yes queen, read that again: the fatal one should not return, the nonfatal one usually returns. know the difference, it's lowkey important π«Άnum_paramsβ specifies the number of values in the parameter list. count them, bestie.paramsβ specifies a pointer to a list of values to be stored in the message. it's a pointer, it points, that's the whole job.
π DESCRIPTION π
So here's the tea, fr fr:
The XtAppErrorMsg function calls the high-level error handler and passes the specified information. that's it, that's the move β it's the messenger girlie. she doesn't fix anything, she just delivers the info and lets the handler do her thing. π
The XtAppSetErrorMsgHandler function registers the specified procedure, which is called when a fatal error occurs. so like, you're picking who's on duty when everything is on fire. choose wisely. π₯
The XtAppSetWarningMsgHandler function registers the specified procedure, which is called when a nonfatal error condition occurs. the "hey girl just so you know" department. still important, just less screaming. πΈ
The XtAppWarningMsg function calls the high-level error handler and passes the specified information. same energy as XtAppErrorMsg, different severity. one is a fire alarm, one is a tap on the shoulder.
β οΈ friendly reminder from your girl:XtAppErrorMsgis_X_NORETURN, meaning it does not return. don't be out here writing code after it like it's coming back. it is not. periodt.
π¦ SEE ALSO π¦
XtAppGetErrorDatabase(3)XtAppError(3)- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language X Interface
π sign-off π
this page comes to you courtesy of X Version 11, libXt 1.3.1, and it's filed under XtAppErrorMsg(3) in the manual. read her, love her, handle your errors responsibly. mwah πβ¨π
π¦ 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