Previous: Listbox widgets
Up: Widgets
Next: Scale widgets
Previous Page: Listbox widgets
Next Page: Scale widgets

Text widgets

Text widgets are complex widgets, which allow many lines of text to be entered, and edited. Editing can be performed by moving the cursor into the text with the mouse, and typing or deleting characters as appropriate. Text widgets are complex in their operation, and support a number of different features, including the ability to mark and tag included text for highlighting purposes, and to all the use of displayed tact characters for selection by an event such as a mouse press.

text .text1 -width 45 -height 5 -relief sunken
   pack .text1

#The following is another example of a widget specific command - #this is the insert operation for text widgets, which #inserts a list of characters starting at line 1, character 0.

.text1 insert 1.0 " Twas brillig and the slithy toves did gyre and gimble in the wabe All mimsy were the borogoves and the mome raths outgrabe"

Text widgets provide a powerful tool for generating applications program components, such as editors.

If you have followed the text so far, you should now be able to use the very basic widgets provided by TCL/TK. There are several other widgets, whose use will be described later.

csstddm@brunel.ac.uk
Fri Aug 19 16:55:19 BST 1994