XtGetSelectionValue()XtGetSelectionValue()Name
XtGetSelectionValue - request the value of a selection.
Synopsis
void XtGetSelectionValue(w, selection, target, callback, client_data,
time)
Widget w;
Atom selection;
Atom target;
XtSelectionCallbackProc callback;
XtPointer client_data;
Time time;
Inputs
w Specifies the widget that is making the request. Must be of
class Core or any subclass thereof.
selection Specifies the particular selection desired (usually XA_PRI‐
MARY or XA_SECONDARY).
target Specifies the type of information about the selection that is
being requested.
callback Specifies the callback procedure to be called when the selec‐
tion value has been obtained. Note that this is how the
selection value is communicated back to the client.
client_data
Specifies an argument to be passed to callback when it is
called.
time Specifies the timestamp that indicates when the selection is
desired. This should be the timestamp of the event that
triggered this request; the value CurrentTime is not accept‐
able.
DescriptionXtGetSelectionValue() initiates an ICCCM-compliant request to the owner
of the selection identified by selection to convert that selection to
the type identified by target, and registers callback as the procedure
to be called (with client_data as one of its arguments) when the con‐
verted value is ready.
callback will be called some time after XtGetSelectionValue() is
called. It may be called before or after XtGetSelectionValue()
returns. If there is no owner for the selection or if the owner could
not convert to the requested type, callback will be called with a value
of NULL and length zero.
If multiple calls to the server are required to get all the data, this
will be transparent to the widget; the Intrinsics perform all the nec‐
essary fragmentation and reassembly of the selection.
See XtSelectionCallbackProc(2) for information on how to write a call‐
back appropriate to register with this function.
Usage
Because of the asynchronous nature of interclient communication, it is
not possible to call a function that returns the value of the selection
immediately. When you need the value of the selection, to paste it
into a widget, for example, you must call XtGetSelectionValue() and
supply a callback which will be called at some later time. It is in
this callback that you can actually perform your paste.
To determine the target types that the selection owner will be willing
to return, intern the string "TARGETS" using XInternAtom(), and send
the corresponding Atom as target.
To (atomically) request that a selection value be converted to several
target types, use XtGetSelectionValues().
See AlsoXtGetSelectionValues(1), XtGetSelectionValueIncremental(1), XtOwnSelec‐
tion(1),
XtSelectionCallbackProc(2).
Xt - Selections XtGetSelectionValue()