The selection Command

There are two Tcl commands that deal with selections. The selection command is a general-purpose command that can set and get different selections. By default it manipulates the PRIMARY selection. The clipboard command stores data for later retrieval using the CLIPBOARD selection.

The selection command exposes the fully general selection model of different selections, types, and formats. You can define selection handlers that return selection values, and you can assert ownership of a selection and find out when you lose ownership to another application. Example 35-5 on page 512 shows a selection handler for a canvas.

A selection can have a type. The default is STRING. The type is different than the name of the selection ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.