XtLoseSelectionProc() XtLoseSelectionProc()
Name
XtLoseSelectionProc - interface definition for procedure to notify the selection owner it has lost selection ownership.
Synopsis
typedef void (*XtLoseSelectionProc)(Widget, Atom *);
Widget w;
Atom *selection;
Inputs
w Specifies the widget that has lost selection ownership.
selection Specifies the atom that names the selection.
Description
An XtLoseSelectionProc is optionally registered in a call to XtOwnSelection() and is called by the Intrinsics when the widget it was regis-
tered with loses the selection because another widget or client has claimed the selection. It is not called when the selection owner
relinquishes selection ownership with XtDisownSelection(). This procedure should take whatever action is appropriate for the widget or
application when it loses selection ownership.
Note that this procedure is not a request to the widget to relinquish selection ownership; it is called after the widget has already lost
the selection.
Usage
Most selection owners (widgets or applications) will want to display selected data highlighted in some way, and so will need to be informed
when they lose the selection so that they can unhighlight that data.
An XtLoseSelectionIncrProc is a similar procedure type used by the Intrinsics incremental selection transfer mechanism. It takes an addi-
tional client_data argument.
Example
The XtLoseSelectionProc below is from the xcalc client. It simply unhighlights the value currently shown in the calculator display.
/*
* called when xcalc loses ownership of the selection.
*/
/*ARGSUSED*/
void lose(w, selection)
Widget w;
Atom *selection;
{
XawToggleUnsetCurrent(LCD);
}
See AlsoXtDisownSelection(1), XtGetSelectionValue(1), XtGetSelectionValueIncremental(1), XtOwnSelection(1),
XtLoseSelectionIncrProc(2).
Xt - Selections XtLoseSelectionProc()
Check Out this Related Man Page
XtOwnSelection(3) XT FUNCTIONS XtOwnSelection(3)NAME
XtOwnSelection, XtOwnSelectionIncremental, XtDisownSelection - set selection owner
SYNTAX
Boolean XtOwnSelection(Widget w, Atom selection, Time time, XtConvertSelectionProc convert_proc, XtLoseSelectionProc lose_selection, XtSe-
lectionDoneProc done_proc);
Boolean XtOwnSelectionIncremental(Widget w, Atom selection, Time time, XtConvertSelectionIncrProc convert_callback, XtLoseSelectionIncrProc
lose_callback, XtSelectionDoneIncrProc done_callback, XtCancelConvertSelectionProc cancel_callback, XtPointer client_data);
void XtDisownSelection(Widget w, Atom selection, Time time);
ARGUMENTS
convert_proc
Specifies the procedure that is to be called whenever someone requests the current value of the selection.
done_proc Specifies the procedure that is called after the requestor has received the selection or NULL if the owner is not interested in
being called back.
lose_selection
Specifies the procedure that is to be called whenever the widget has lost selection ownership or NULL if the owner is not inter-
ested in being called back.
selection Specifies an atom that describes the type of the selection (for example, XA_PRIMARY, XA_SECONDARY, or XA_CLIPBOARD).
time Specifies the timestamp that indicates when the selection ownership should commence or is to be relinquished.
w Specifies the widget that wishes to become the owner or to relinquish ownership.
DESCRIPTION
The XtOwnSelection function informs the Intrinsics selection mechanism that a widget believes it owns a selection. It returns True if the
widget has successfully become the owner and False otherwise. The widget may fail to become the owner if some other widget has asserted
ownership at a time later than this widget. Note that widgets can lose selection ownership either because someone else asserted later own-
ership of the selection or because the widget voluntarily gave up ownership of the selection. Also note that the lose_selection procedure
is not called if the widget fails to obtain selection ownership in the first place.
The XtOwnSelectionIncremental procedure informs the Intrinsics incremental selection mechanism that the specified widget wishes to own the
selection. It returns True if the specified widget successfully becomes the selection owner or False otherwise. For more information about
selection, target, and time, see Section 2.6 of the Inter-Client Communication Conventions Manual.
A widget that becomes the selection owner using XtOwnSelectionIncremental may use XtDisownSelection to relinquish selection ownership.
The XtDisownSelection function informs the Intrinsics selection mechanism that the specified widget is to lose ownership of the selection.
If the widget does not currently own the selection either because it lost the selection or because it never had the selection to begin
with, XtDisownSelection does nothing.
After a widget has called XtDisownSelection, its convert procedure is not called even if a request arrives later with a timestamp during
the period that this widget owned the selection. However, its done procedure will be called if a conversion that started before the call
to XtDisownSelection finishes after the call to XtDisownSelection.
SEE ALSO XtAppGetSelectionTimeout(3), XtGetSelectionValue(3)
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface
X Version 11 libXt 1.1.3 XtOwnSelection(3)