XtAddInput(3)
β¨ XtAddInput β the manual page bestie π
okay so real talk, this one's a compatibility situation, it's giving "we keep the old thing around so your ancient code still compiles" energy, and honestly? iconic of libXt. π«Ά
π« NAME π«
XtAddInput, XtAddTimeOut, XtAddWorkProc β the trio that registers input, timeout, and workprocs, no cap β¨
πΈ SYNTAX πΈ
first things first, you gotta bring in the header, literally the doorway:
#include <X11/Intrinsic.h>
then the three besties, one at a time:
XtInputId XtAddInput(int source, XtPointer condition,
XtInputCallbackProc proc, XtPointer client_data);
XtIntervalId XtAddTimeOut(unsigned long interval, XtTimerCallbackProc
proc, XtPointer client_data);
XtWorkProcId XtAddWorkProc(XtWorkProc proc, XtPointer client_data);
look at those return types. XtInputId, XtIntervalId, XtWorkProcId. they hand you back an ID and you hold onto it, periodt π
π ARGUMENTS π
okay so here's what you're feeding these functions, one by one, don't skip a single one:
client_dataβ this is the lil gift you wrap up and pass along; it's the argument that gets handed to the procedure you specified when input becomes available πconditionβ the mask, bestie. it says whether we're talking a read, a write, or an exception condition, or some operating-system-dependent condition πprocβ the procedure that gets called when input is available. your callback, your moment, your main character entrance π₯sourceβ the source file descriptor if you're on a UNIX-based system, or some other operating-system-dependent device specification if you're not π
π DESCRIPTION π
so here's the tea, and I need you to sit with it:
XtAddInput has been replaced by XtAppAddInput. π
XtAddTimeOut has been replaced by XtAppAddTimeOut. π
XtAddWorkProc has been replaced by XtAppAddWorkProc. π
that's the whole description, fr fr. all three of these are the old way, and the new way lives in XtAppAddInput, XtAppAddTimeOut, and XtAppAddWorkProc. if you're writing new code, go hang with the XtApp girlies. if you're maintaining something ancient, well, you're in the right place and we love you for it π«Ά
not me telling you that all three functions here are the superseded versions. no shade, just facts. β¨
π SEE ALSO π
go read these next, they're the glow-ups:
XtAppAddInput(3)XtAppAddTimeOut(3)XtAppAddWorkProc(3)- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language X Interface
π¦ sign-off π¦
this page came from X Version 11, libXt 1.3.1 β that's the version and the date vibe of this lil document, and it was served fresh from the libXt household π
stay hydrated, read your headers, and remember: XtAddInput is a legacy queen but XtAppAddInput is the one you call. bye bestie!! πΈπβ¨
π¦ 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