XtNextEvent(3)

πŸ’– XtNextEvent β€” the girlies' guide to querying and processing events πŸ’–

okay so bestie, welcome to the XtNextEvent manual page, straight out of the XT COMPATIBILITY FUNCTIONS section of libXt. these are the legacy girls β€” the originals β€” and they're all about querying and processing events and input. πŸ¦‹


✨ NAME ✨

XtNextEvent, XtPending, XtPeekEvent, XtProcessEvent, XtMainLoop β€” query and process events and input, no cap. πŸ‘‘


✨ SYNTAX ✨

first thing you do, always: pull in the header. iconic behavior.

#include <X11/Intrinsic.h>

then the five function signatures, verbatim, don't @ me:

void XtNextEvent(XEvent *event_return);

Boolean XtPeekEvent(XEvent *event_return);

Boolean XtPending(void);

void XtProcessEvent(XtInputMask mask);

void XtMainLoop(void);

✨ ARGUMENTS ✨

  • event β€” this one's a pointer to the event structure that's gonna get dispatched to the appropriate event handler. it's giving "hand off the mail to the right mailbox". πŸ“¬
  • event_return β€” the event info comes back to you in this event structure you specified. it literally returns the event information there. πŸ’Œ
  • mask β€” this tells you what types of events to process. it's the bitwise inclusive OR of any combination of XtIMXEvent, XtIMTimer, XtIMAlternateInput, and XtIMSignal. and as a lil convenience, the X Toolkit defines the symbolic name XtIMAll to be the bitwise inclusive OR of all event types. so like, XtIMAll = all of them, periodt. 🌈

✨ DESCRIPTION ✨

okay so here's the tea, and it's a little sad but we move: every single one of these has been replaced. 😭

  • XtNextEvent has been replaced by XtAppNextEvent.
  • XtPeekEvent has been replaced by XtAppPeekEvent.
  • XtPending has been replaced by XtAppPending.
  • XtProcessEvent has been replaced by XtAppProcessEvent.
  • XtMainLoop has been replaced by XtAppMainLoop.

like, they're still here, they still work, but the glow-up versions exist and you should lowkey be using those. this is the compatibility corner of the library, bestie. πŸ’…


✨ SEE ALSO ✨

go read these next, fr fr:


and that's the whole page, bestie. short, sweet, and entirely made of "use the App version instead". πŸ’€

mwah πŸ’‹ this page came to you from X Version 11, libXt 1.3.1 β€” so like, this is the libXt girlies' era, not the Xlib one. take care of her, she's vintage. πŸŽ€

πŸ“¦ where this page comes from