Tk_OwnSelection(3)
π NAME π
Okay so this is the Tk_OwnSelection(3) page from the Tk Library Procedures, and it's literally about making a window the owner of the primary selection. Main character energy for windows, no cap π
β¨ SYNOPSIS β¨
#include <tk.h>
Tk_OwnSelection(tkwin, selection, proc, clientData)
π ARGUMENTS π
Tk_Window tkwin(in) β the window that's about to become the new selection owner. Go off,tkwinπAtom selection(in) β the name of the selection to be owned, likeXA_PRIMARY. Iconic atom behavior.Tk_LostSelProc *proc(in) β the procedure to invoke whentkwinloses selection ownership later. Think of it as the cleanup crew π§Ήvoid *clientData(in) β an arbitrary one-word value to pass toproc. A little surprise gift for later π
πΈ DESCRIPTION πΈ
So 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. Slay, that's the whole vibe.
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. Very demure, very mindful cleanup π«Ά
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. Basically a little VIP pass back to your own data π³β¨
π¦ KEYWORDS π¦
- own
- selection owner
Bye bestie β this page is from Tk 4.0 and it's the Tk_OwnSelection(3) page. The footer doesn't give a date, so that's the whole source/version moment. Periodt π«Άπ
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 1990-1994 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms