Cover V05, I08
Figure 1
Figure 2
Figure 3
Listing 1
Listing 2
Sidebar 1


Sidebar: What Is Tcl/Tk?

A brief explanation of Tcl/Tk comes from Brent B. Welch in Practical Programming in Tcl and Tk. "Tcl stands for Tool Command Language. Tcl is really two things: a scripting language and an interpreter for that language that is designed to be easy to embed into your application. Tcl and its associated X Window toolkit, Tk, were designed and crafted by Professor John Ousterhout of the University of California, Berkeley."

What Are the Advantages of Tcl/Tk?

According to Ousterhout, there are four benefits to Tcl/Tk. "The first benefit is rapid development. Many interesting GUI applications can be written entirely as Tcl scripts, using a windowing shell called wish.... The second benefit is that Tcl makes it easy for applications to have powerful scripting languages. To create a new application, all you need to do is implement a few new Tcl commands that provide the basic features of the application... The third benefit of Tcl is that it makes an excellent 'glue package.' A Tcl application can include many different library packages, each of which provides an interesting set of Tcl commands.... The fourth benefit of Tcl is user convenience. Once you learn Tcl and Tk, you will be able to write scripts for any Tcl and Tk application merely by learning the few application-specific commands for the new application."

I like Tcl/Tk because it has allowed me to convert a lot of my Bourne and C shell scripts into more user-friendly, graphical type packages without the hassle of converting them into C and/or Motif.

What Is wish?

wish is an interpreter for Tcl/Tk written applications. By placing the #!/usr/local/bin/wish -f line at the beginning of your Tcl/Tk application, (assuming /usr/local/bin is the home to your wish interpreter), you can make your Tcl/Tk program directly executable, exactly as you do for Bourne and C shell programs.

How Can I Get Tcl/Tk for My System?

Tcl/Tk is freely available via anonymous ftp from the University of California, Berkeley at the following address: It is also available on the CDs that accompany these books: UNIX System Administration Handbook, X User Tools, and The UNIXSystem Administrator's Guide to X.