XtAddEventHandler(3)
π XtAddEventHandler β the XT FUNCTIONS girlies π
okay bestie so this is the XtAddEventHandler(3) page, and it's literally about adding and removing event handlers. Six whole functions, one adorable little enum, let's GO π
β¨ NAME β¨
XtAddEventHandler, XtAddRawEventHandler, XtRemoveEventHandler, XtRemoveRawEventHandler, XtInsertEventHandler, XtInsertRawEventHandler β add and remove event handlers π¦
πΈ SYNTAX πΈ
#include <X11/Intrinsic.h>
void XtAddEventHandler(Widget w, EventMask event_mask, Boolean
nonmaskable, XtEventHandler proc, XtPointer client_data);
void XtAddRawEventHandler(Widget w, EventMask event_mask, Boolean
nonmaskable, XtEventHandler proc, XtPointer client_data);
void XtRemoveEventHandler(Widget w, EventMask event_mask, Boolean
nonmaskable, XtEventHandler proc, XtPointer client_data);
void XtRemoveRawEventHandler(Widget w, EventMask event_mask, Boolean
nonmaskable, XtEventHandler proc, XtPointer client_data);
void XtInsertEventHandler(Widget w, EventMask event_mask, Boolean
nonmaskable, XtEventHandler proc, XtPointer client_data,
XtListPosition position);
void XtInsertRawEventHandler(Widget w, EventMask event_mask, Boolean
nonmaskable, XtEventHandler proc, XtPointer client_data,
XtListPosition position);
typedef enum { XtListHead, XtListTail } XtListPosition;
like... six signatures and an enum, no cap, that's the whole vibe π
π«Ά ARGUMENTS π«Ά
client_dataβ extra data that gets passed along to your event handler. it's your little care package π¦event_maskβ the event mask you're calling or unregistering this procedure for.nonmaskableβ a Boolean that says whether this procedure should be called or removed on the nonmaskable events, which are:GraphicsExpose,NoExpose,SelectionClear,SelectionRequest,SelectionNotify,ClientMessage, andMappingNotify. those seven. the untouchables β¨procβ the procedure being added or removed. the main character, fr.wβ the widget you're registering this event handler for.positionβ when the event handler gets called relative to the other handlers you already registered. lineup energy π
π DESCRIPTION π
XtAddEventHandler registers a procedure with the dispatch mechanism, and that procedure is to be called when an event matching the mask occurs on the specified widget. If the procedure is already registered with the same client_data, the specified mask gets ORed into the existing mask. And if the widget is realized, XtAddEventHandler calls XSelectInput, if necessary. slay π
XtAddRawEventHandler is similar to XtAddEventHandler except β and this is the whole plot twist β it does not affect the widget's mask and never causes an XSelectInput for its events. note that the widget might already have those mask bits set because of other nonraw event handlers registered on it. iykyk π¦
XtRemoveRawEventHandler stops the specified procedure from receiving the specified events. because the procedure is a raw event handler, this does not affect the widget's mask and never causes a call on XSelectInput. bye bestie π
XtInsertEventHandler is identical to XtAddEventHandler with the additional position argument. If position is XtListHead, the event handler is registered so it'll be called before any event handlers that were previously registered for the same widget β front of the line, main character energy. If position is XtListTail, the event handler is registered to be called after any previously registered event handlers. and if the procedure is already registered with the same client_data value, the specified mask augments the existing mask and the procedure gets repositioned in the list. it moved. periodt. π
XtInsertRawEventHandler is similar to XtInsertEventHandler except it does not modify the widget's event mask and never causes an XSelectInput for the specified events. and same as before: if the procedure is already registered with the same client_data value, the specified mask augments the existing mask and the procedure is repositioned in the list. π
ngl the raw variants are giving "i don't touch your mask, i just show up" and honestly? iconic. but fr fr, remember the raw ones never call XSelectInput β that's the whole point of them.
π₯ SEE ALSO π₯
XtAppNextEvent(3)XtBuildEventMask(3)- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language X Interface
and that's the page, bestie!! π this whole thing is from X Version 11, libXt 1.3.1 β go register a handler, you absolute legend πβ¨
π¦ 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