Chapter 8. The Text, TextUndo,and ROText Widgets
The Text widget is one of the most powerful standard widgets available in Perl/Tk. It is flexible, configurable, and easy to use for simple tasks. You can use Text widgets to:
Display and edit a plain text file
Display formatted text from an HTML document
Create a scrollable color key, with Buttons that allow you change the colors
Gather multiline, formatted text (including colors) from a user (act as a mini word processor)
Display text with different colors based on the input
Create hypertext windows that perform actions when clicked (either HTML or similar to the widget demo).[1]
You can put text as well as other widgets inside a Text widget. A Text widget can be used in conjunction with Scrollbars to allow many pages of information to be viewed in much less space.
[1] When you installed the Tk module with Perl, you also installed
the widget demo. Type
widget on the command line to see the
capabilities of widgets in Perl/Tk.
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