XtGetSelectionValue(3)
π NAME π
XtGetSelectionValue, XtGetSelectionValues β bestie, we're getting selection values. that's the whole job. obtaining them. slay.
β¨ SYNTAX β¨
first, the include, don't forget it or nothing works:
#include <X11/Intrinsic.h>
void XtGetSelectionValue(Widget w, Atom selection, Atom target,
XtSelectionCallbackProc callback, XtPointer client_data, Time
time);
void XtGetSelectionValues(Widget w, Atom selection, Atom *targets, int
count, XtSelectionCallbackProc callback, XtPointer *client_data,
Time time);
two functions, one vibe. the singular one asks for one thing, the plural one asks for a whole list of things at once. π
π ARGUMENTS π
okay so here's every single one, in order, no skipping, i promise:
callbackβ the callback procedure that gets called when the selection value has been obtained. it's giving "we'll ring you when your order's ready" energy.client_dataβ the argument that is passed to the specified procedure when it is called. (this is the singularXtGetSelectionValueversion, one blob of data, one callback.)client_dataβ the client data, one for each target type, passed to the callback procedure when it's called for that target. (this is theXtGetSelectionValuesversion β yes it has the same name, no that's not a typo, it's a list now. the way thatβ¦)countβ the length of thetargetsandclient_datalists. so you better keep them matching, fr fr.selectionβ the particular selection you want, like primary or secondary. which one, bestie, pick.targetβ the type of information that is needed about the selection. singular. one target.targetsβ the types of information that are needed about the selection. plural. a whole array of them. main character energy.timeβ the timestamp that indicates when the selection value is desired.wβ the widget that is making the request. the one doing the asking. π«Ά
π¦ DESCRIPTION π¦
XtGetSelectionValue requests the value of the selection that has been converted to the target type. and here's the lowkey unhinged part: the callback you specified gets called some time after XtGetSelectionValue is called β and honestly it may be called before XtGetSelectionValue returns, or after it returns. either way. no cap. so don't go assuming anything about ordering, that's just how it is. π
XtGetSelectionValues is literally the same situation as XtGetSelectionValue, except it takes a list of target types and a list of client data, and grabs the current value of the selection converted to each of the targets. the effect is as if each target were specified in its own separate call to XtGetSelectionValue. the callback gets called once with the corresponding client data for each target. and here's the glow-up: XtGetSelectionValues does guarantee that all the conversions will use the same selection value, because ownership of the selection can't change in the middle of the list β which is exactly the mess you'd get if you just called XtGetSelectionValue over and over again. periodt. β¨
πΈ SEE ALSO πΈ
XtAppGetSelectionTimeout(3)XtOwnSelection(3)X Toolkit Intrinsics - C Language InterfaceXlib - C Language X Interface
heads up bestie, that callback timing thing is real: it can fire before XtGetSelectionValue even returns. write your callback like it's the main character and don't depend on the order. π
okay that's the whole page, ily, go get those selection values. this was X Version 11, libXt 1.3.1, and it's giving XtGetSelectionValue(3) π¦β¨π
π¦ 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