The Text Widget

Create a Text widget with the Text method:

$parentwidget->Text ( options)

The standard configuration options that apply to Text are: -background, -bg, -bor-derwidth, -bd, -cursor, -exportselection, -font, -foreground, -fg, -height, -high-lightbackground, -highlightcolor, -highlightthickness, -insertbackground, -in-sertborderwidth, -insertofftime, -insertontime, -insertwidth, -padx, -pady, -re-lief, -selectbackground, -selectborderwidth, -selectforeground, -state, -takefo-cus, -width, -xscrollcommand, and -yscrollcommand.

Other options are:

-setgrid => boolean

Turns on gridding for the Text widget. Default is 0 (off).

-spacing1 => amount

Defines the amount of space left on the top of a line of text that starts on its own line. Default is 0.

-spacing2 => amount

Defines the amount of space left on the top of a line of text after it has been automatically wrapped by the Text widget. Default is 0.

-spacing3 => amount

Defines the amount of space left after a line of text that has been ended by \n. Default is 0.

-tabs => list

Specifies a list of tab stops to use in the text widget. Default is undefined (no tab stops).

-wrap => mode

Sets the mode for determining automatic line wrapping. Values are none (no wrapping), char (wrap at any character), or word (wrap at a word boundary). Default is char.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.