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
insert
mark, with basic compensation for tab characters.-
$text->deleteSelected
Deletes the currently selected text.
-
$text->DeleteTextTaggedWith(
tag
)
Deletes the text tagged with the ...
Get Mastering Perl/Tk 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.