Tcl/tk Examples


Desk Utility

This is a purely tcl/tk application which has a clock, responds to mail and gives a selection of servers to remote log into. The clock is in 24 hour time and it goes to reverse video when the user gets new mail. The application is capable of taking a "-geometry" parameter that causes positioning in the standard X Window style. A small push button displays a pull down menu which has a list of servers which when selected creates a remote login session with the appropriate xhost and DISPLAY settings. The selection of servers is taken from a global string near the top of the file called "hosts".

This program uses the following commands:

Click here to see the xmail application


Sample integrated C & tcl/tk application

This application may seem a little strange as it was used to interface to a much more complicated piece of software, but it has the basics needed to show how to integrate C and tcl/tk. The application shows a list of entry boxes and some buttons. When information was entered in certain entry fields and the button was pushed, other fields would be updated. There is some code here that interfaces to a shared memory device, which was the method for talking to the larger application. The header files that were required for this interface are not included below, so compiling this program without modification won't be possible, but it isn't a bad example to read.

The Makefile

The script file: pr1

The C file: proof.c