The Example Browser

Example 22-3 is a browser for the code examples that appear in this book. The basic idea is to provide a menu that selects the examples, and a text window to display the examples. Before you can use this sample program, you need to edit it to set the proper location of the exsource directory that contains all the example sources from the book. Example 22-4 on page 329 extends the browser with a shell that is used to test the examples.

Example 22-3 A browser for the code examples in the book.
 #!/usr/local/bin/wish # Browser for the Tcl and Tk examples in the book. # browse(dir) is the directory containing all the tcl files # Please edit to match your system configuration. switch $tcl_platform(platform) { "unix" {set browse(dir) ...

Get Practical Programming in Tcl & Tk, Third Edition 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.