O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required