For more details: ``Tcl and the Tk Toolkit'' by John Ousterhout (creator of Tcl/Tk) Addison-Wesley, 1994, ISBN 0-201-63337-X
Tcl (Tool Command Language) and Tk (X11 Toolkit for use with Tcl) are convenient tools for building and debugging graphical user interfaces.
/usr/local/cmb/wishxYou can interactively build a GUI by running wishx, and then typing Tcl commands at the prompt. A window will open when wishx is run and as you type Tcl commands, the effects will be seen in the window. With Tcl you can define and place widgets like buttons, text entry fields, sliders, etc. in the GUI. Actions are attached to each widget, and the appropriate action will be executed with the widget is clicked, slid, etc.
There are other ways to use Tcl/Tk. For example, Tk routines can be invoked from C program you write. It is a X windows toolkit like Motif. However, the power of using wishx is the interactivity and ease/speed of debugging the interface code, which is traditionally complicated, tedious to write, and error prone.
Here is a more complicated TCL SCRIPT that opens a window, takes input from the keyboard, and computes a base raised to a power. To use the text entry fields, you must first click the left mouse button on the field; then it will take typing. The script has been written to allow CR, right mouse button click, or the "r" key to activate the computation... try it!
Finally, here is an interesting TCL SCRIPT for remembering and running Unix commands. It had a text entry field for extering and executing a command. It then adds a button to a menu, remembering the command and allowing the user to re-run the command by clicking on the button. It holds a max of 7 commands, then rolls the oldest off the end.