Chapter 33. The Text Widget

   

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

Table of Contents
Part IV.  Tk Widgets


Tk text widget is a general-purpose editable text widget with features for line spacing, justification, tags, marks, and embedded windows.

The Tk text widget is versatile, simple to use for basic text display and manipulation, and has many advanced features to support sophisticated applications. The line spacing and justification can be controlled on a line-by-line basis. Fonts, sizes, and colors are controlled with tags that apply to ranges of text. Edit operations use positional marks that keep track of locations in text, even as text is inserted and deleted.

Tags are the most important feature of the text widget. You can define attributes like font and justification for a tag. When that tag is applied to a range of text, the text uses those attributes. Text can pick up attributes from any number of tags, so you can compose different tags for justification, font, line spacing, and more. You can also define bindings for tags so that ranges of text can respond to the mouse. Any interesting application of the text widget uses tags extensively.


       
    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