The Selection

   

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

Table of Contents
Chapter 33.  The Text Widget


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 the tags on the text widget with the following command. The eval command is used to join the list of tag names into the tag delete command:

 eval {$t tag delete}[$t tag names] 

       
    Top
     



    Practical Programming in Tcl and Tk
    Practical Programming in Tcl and Tk (4th Edition)
    ISBN: 0130385603
    EAN: 2147483647
    Year: 1999
    Pages: 478

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net