O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

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

The Perl/Tk Text Widget Extended Methods

These methods are available only with the Perl/Tk Text widget and are documented nowhere else but in this book. Another unique feature is the built-in Menu, activated by a <Button-3> click, which calls many of these methods for common text-related activities. The built-in Menu is shown in Figure 8-7.

Built-in Menu

Figure 8-7. Built-in Menu

To disable the default Menu, use $text->menu(undef). To supply your own Menu, first create it and then use $text->menu(my_menu).

Here, then, is the complete list of extended Text widget methods. These methods should be considered experimental, so use them with caution and expect that you may have to change your code in the future.

$text->adjustSelect

Moves the end point of selection and anchor point to the mouse pointer location.

$text->clipboardColumnCopy

Performs a rectangular copy of the currently selected text, with basic compensation for tab characters.

$text->clipboardColumnCut

Performs a rectangular cut of the currently selected text, with basic compensation for tab characters.

$text->clipboardColumnPaste

Performs a rectangular paste of the text in the clipboard. The upper-left corner is specified by the current position of the insert mark, with basic compensation for tab characters.

$text->deleteSelected

Deletes the currently selected text.

$text->DeleteTextTaggedWith( tag )

Deletes the text tagged with the ...

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