Tk\_OwnSelection(3) Tk Library Procedures Tk\_OwnSelection(3)

```

```

# [NAME](#NAME)

Tk\_OwnSelection - make a window the owner of the primary selection

# [SYNOPSIS](#SYNOPSIS)

```
#include <tk.h>

Tk_OwnSelection(tkwin, selection, proc, clientData)
```

# [ARGUMENTS](#ARGUMENTS)

Tk\_Window *tkwin* (in)

Window that is to become new selection owner.

Atom *selection* (in)

The name of the selection to be owned, such as XA\_PRIMARY.

Tk\_LostSelProc *\*proc* (in)

Procedure to invoke when *tkwin* loses selection ownership later.

void *\*clientData* (in)

Arbitrary one-word value to pass to *proc*.

```
    
```

# [DESCRIPTION](#DESCRIPTION)

**Tk\_OwnSelection** arranges for *tkwin* to become the new owner of the selection specified by the atom *selection*. After this call completes, future requests for the selection will be directed to handlers created for *tkwin* using **Tk\_CreateSelHandler**. When *tkwin* eventually loses the selection ownership, *proc* will be invoked so that the window can clean itself up (e.g. by unhighlighting the selection). *Proc* should have arguments and result that match the type **Tk\_LostSelProc**:

```
typedef void Tk_LostSelProc(


        void *clientData);
```

The *clientData* parameter to *proc* is a copy of the *clientData* argument given to **Tk\_OwnSelection**, and is usually a pointer to a data structure containing application-specific information about *tkwin*.

# [KEYWORDS](#KEYWORDS)

own, selection owner

4.0 Tk

---

Document: Tk_OwnSelection(3) from tk 9.0.4-r2 (Chainguard OS)
Source: https://downloads.sourceforge.net/sourceforge/tcl/tk9.0.4-src.tar.gz
