Chapter 16. GUI Example: Man Page Viewer

Help wanted. Telepath. You know where to apply.

Anonymous

The primary objective of this chapter is to exercise some of the most important capabilities of Tk’s text widget; a man page viewer called perlman provides an ideal test case.[58] In this chapter, you will familiarize yourself with the widget’s text insertion, deletion, and retrieval capabilities; use a variety of indexing primitives; create and configure tags; and perform regular expression searching and highlighting of text. Along the way, you’ll also learn to use entry widgets and construct menus dynamically.

perlman is modeled after TkMan [Section 16.3], a very nice man page viewer written by Thomas Phelps at the University of California at Berkeley, using Tcl/Tk. perlman contains only a small subset of TkMan’s functionality.

Thomas has also written an experience paper entitled “Two Years with TkMan: Lessons and Innovations. Or, Everything I Needed to Know about Tcl/Tk I Learned from TkMan” [2]. It presents a good case for writing the entire utility in a scripting language and unwittingly convinces us, smug Perl programmers that we are, why Perl would have been the ideal choice. Please see the Section 16.3 section at the end of this chapter for pointers to TkMan and this paper.

man and perlman

Unix manual pages are normally viewed by the man(1) command. When you say man perl at the command line, it searches the list of directories indicated by the environment variable MANPATH ...

Get Advanced Perl Programming 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.