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.

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
insertmark, with basic compensation for tab characters.-
$text->deleteSelected Deletes the currently selected text.
-
$text->DeleteTextTaggedWith(tag) Deletes the text tagged with the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access