XtAddCallback(3)
β¨ XtAddCallback β the XT FUNCTIONS girlies π
ok so bestie, welcome to XtAddCallback(3) and its whole friend group π«Ά these are the functions that let you hook callback procedures onto a widget's callback list β and also, crucially, un-hook them when you're done. adding, removing, removing literally everything. the full cycle. it's giving main character energy for real.
πΈ NAME πΈ
XtAddCallback, XtAddCallbacks, XtRemoveCallback, XtRemoveCallbacks, XtRemoveAllCallbacks β add and remove callback procedures π
β¨ SYNTAX β¨
first things first, you gotta pull in the header, no cap:
#include <X11/Intrinsic.h>
then the whole squad, in order:
void XtAddCallback(Widget w, const char *callback_name, XtCallbackProc
callback, XtPointer client_data);
void XtAddCallbacks(Widget w, const char *callback_name, XtCallbackList
callbacks);
void XtRemoveCallback(Widget w, const char *callback_name,
XtCallbackProc callback, XtPointer client_data);
void XtRemoveCallbacks(Widget w, const char *callback_name,
XtCallbackList callbacks);
void XtRemoveAllCallbacks(Widget w, const char *callback_name);
π ARGUMENTS π
ok so here's who's who in the group chat:
callbackβ specifies the callback procedure. that's the function itself, the whole point, the moment πcallbacksβ specifies the null-terminated list of callback procedures and corresponding client data. yes bestie, a list, plural, we're doing this in bulk π¦callback_nameβ specifies the callback list to which the procedure is to be appended or deleted. like, which list are we talking to.client_dataβ specifies the argument that is to be passed to the specified procedure when it is invoked byXtCallbacksorNULL, or the client data to match on the registered callback procedures. so it's either the lil gift you hand to your callback, orNULL, or the thing you're matching against when you're hunting down a callback to remove πwβ specifies the widget. the widget!! the star of the show β¨
π DESCRIPTION π
XtAddCallback adds the specified callback procedure to the specified widget's callback list. boom. added. welcome to the list, bestie π
XtAddCallbacks adds the specified list of callbacks to the specified widget's callback list. plural girlies, we're adding many at once, obsessed π
XtRemoveCallback removes a callback only if both the procedure and the client data match. okay so this one is picky β and honestly? valid. it's not gonna remove just anything, it needs both to line up or it's not doing it. periodt π
XtRemoveCallbacks removes the specified callback procedures from the specified widget's callback list. the batch removal. the cleanup era π§Ή
XtRemoveAllCallbacks removes all the callback procedures from the specified widget's callback list. every single one. scorched earth. no survivors. iconic π
π₯ SEE ALSO π₯
go read these next, iykyk:
XtCallCallbacks(3)X Toolkit Intrinsics - C Language InterfaceXlib - C Language Interface
and that's the whole page, babe! π this one's from X Version 11, libXt 1.3.1 β shoutout to the XT FUNCTIONS girlies for keeping the callback lists cute since forever. 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 (c) 1993, 1994 X Consortium
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms