O'Reilly logo

Tcl/Tk in a Nutshell by Paul Raines, Jeff Tranter

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

Name

text

text pathName [option value...]

The text command creates a new text widget named pathName. A text widget displays one or more lines of text and allows that text to be edited. Several options exist to change the text's style (fonts, color, justification, etc.). Tags can be assigned to regions of text to allow different styles to be applied. The text widget also allows the embedding of images and other windows. Floating marks can be set to keep track of special points in the text.

Standard Options

-background

-borderwidth

-cursor

-exportselection

-font

-foreground

-highlightbackground

-highlightcolor

-highlightthickness

-insertbackground

-insertborderwidth

-insertofftime

-insertontime

-insertwidth

-padx

-pady

-relief

-selectbackground

-selectborderwidth

-selectforeground

-setgrid

-takefocus

-xscrollcommand

-yscrollcommand

Widget-Specific Options

-height (height, Height)

Desired height for the window, in characters.

-spacing1 (spacing1, Spacing1)

Space to add above each line of text. If the line wraps, the space is added above the first displayed line only.

-spacing2 (spacing2, Spacing2)

Space to add between the lines that display a long, wrapped line of text.

-spacing3 (spacing3, Spacing3)

Space to add below each line of text. If the line wraps, the space is added below the last displayed line only.

-state (state, State)

State of the text widget. State must be normal or disabled. If the text is disabled, no insertions or deletions are allowed.

-tabs (tabs, Tabs)

List of screen distances giving the positions for ...

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