Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtOwnSelecA(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtDisownSelection(1)

XtGetSelectionValue(1)

XtConvertSelectionProc(2)

XtLoseSelectionProc(2)

XtSelectionDoneProc(2)

 

Name

XtOwnSelection — indicate that selection data is available. 

Synopsis

Boolean XtOwnSelection(w, selection, time, convert_proc, lose_proc, done_proc)

    Widget w;
    Atom selection;
    Time time;
    XtConvertSelectionProc convert_proc;
    XtLoseSelectionProc lose_proc;
    XtSelectionDoneProc done_proc;

Arguments

wSpecifies the widget that wishes to become the owner. 

selectionSpecifies an atom that describes the type of the selection (for example, XA_PRIMARY, XA_SECONDARY; these two are declared beforehand in <X11/Xatom.h>). 

timeSpecifies the times when selection ownership should commence.  This should be the timestamp of the event that triggered ownership.  It should be the time field taken directly from an XEvent structure.  The value CurrentTime is not acceptable. 

convert_proc
Specifies the procedure to call whenever someone requests the current value of the selection.

lose_procSpecifies the procedure to call whenever the widget has lost selection ownership, or specifies NULL if the owner is not interested in being called back. 

done_procSpecifies the procedure to call after the transfer completes, or specifies NULL if the owner is not interested in being called back. 

Description

Calling XtOwnSelection is a precursor to sending data through the selection mechanism.  XtOwnSelection informs the Intrinsics of its claim on the selection, and its readiness to send data on request.  XtOwnSelection 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 after this widget, as indicated by time.  Widgets can lose selection ownership either because another client more recently asserted ownership of the selection, or because the widget voluntarily gave up ownership of the selection with XtDisownSelection. 

The lose_proc procedure is invoked when another widget successfully claims the selection after w. The lose_proc procedure is not called if the widget fails to obtain selection ownership in the first place. 

If the widget successfully obtains the selection ownership, subsequent requests for data will be directed to convert_proc. 

XtConvertSelectionProc(2) describes the responsibilities of the widget or application sending data and its conversion duties.  Chapter 10, Interclient Communications, in Volume Four, X Toolkit Intrinsics Programming Manual, presents a complete example widget that both sends and receives data using selection. 

See Also

XtDisownSelection(1), XtGetSelectionValue(1),
XtConvertSelectionProc(2), XtLoseSelectionProc(2), XtSelectionDoneProc(2). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026