Linking tcl and c

How to connect a tcl/tk shell which sets up input buttons and output windows to a c program which does computations took a while for us to figure out. Dan Vernon produced this sample...

You can cut-and-paste the following three programs into a directory on your system. If you have tcl/tk installed, typing

make
and then
minimal
should produce a small tcl interface to a simple c program. Note: you'll have to edit the Makefile: change the eight spaces into a tab or the system will croak.

Statistical Mechanics: Entropy, Order Parameters, and Complexity, now available at Oxford University Press (USA, Europe).