[ Team LiB ] Previous Section Next Section

Text Attributes

Table 36-10 lists the attributes for the text widget. The table uses the resource name, which has capitals at internal word boundaries. In Tcl commands, the attributes are specified with a dash and all lowercase:

Table 36-10. Text attribute resource names

autoSeparators

Boolean: True (default) automatically insert undo separators after each insert or delete operation; False requires the use of the undo separator operation to insert separators. (Tk 8.4)

background

Background color (also bg).

borderWidth

Extra space around the edge of the text.

cursor

Cursor to display when mouse is over the widget.

exportSelection

If true, selected text is exported to the selection.

font

Default font for the text.

foreground

Foreground color (also fg).

height

Height, in text lines.

highlightBackground

Focus highlight color when widget does not have focus.

highlightColor

Color for input focus highlight border.

highlightThickness

Width of highlight border.

insertBackground

Color for the insert cursor.

insertBorderWidth

Size of 3D border for insert cursor.

insertOffTime

Milliseconds insert cursor blinks off.

insertOnTime

Milliseconds insert cursor blinks on.

insertWidth

Width of the insert cursor.

maxUndo

The maximum number of undo actions on the undo stack. A zero or a negative value implies an unlimited undo stack. (Tk 8.4)

padX

Extra space to the left and right of the text.

padY

Extra space above and below the text.

relief

flat, sunken, raised, groove, ridge, or solid.

selectBackground

Background color of selected text.

selectForeground

Foreground color of selected text.

selectBorderWidth

Size of 3D border for selection highlight.

setGrid

Enable/disable geometry gridding.

spacing1

Extra space above each unwrapped line.

spacing2

Space between parts of a line that have wrapped.

spacing3

Extra space below an unwrapped line.

state

Editable (normal) or read-only (disabled).

tabs

Tab stops.

takeFocus

Control focus changes from keyboard traversal.

undo

Boolean: True enables and False (default) disables the undo mechanism. (Tk 8.4)

width

Width, in characters, of the text display.

wrap

Line wrap mode: none, char, or word.

xScrollCommand

Tcl command prefix for horizontal scrolling.

yScrollCommand

Tcl command prefix for vertical scrolling.

    [ Team LiB ] Previous Section Next Section