The Selection

The selection is implemented with a predefined tag named sel. If the application tags characters with sel, those characters are added to the selection. This is done as part of the default bindings on the text widget.

The exportSelection attribute of a text widget controls whether or not selected text is exported by the selection mechanism to other applications. By default the selection is exported. In this case, when another widget or application asserts ownership of the selection then the sel tag is removed from any characters that are tagged with it. Chapter 35 describes the selection mechanism in more detail.

You cannot delete the sel tag with the tag delete operation. However, it is not an error to do so. You can delete all ...

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.