Last updated: 2nd April, 2001
Welcome to my Tcl/Tk archive. Below you'll find listed various things that I've managed to dig out of my collection of tcl scripts and library files, together with (some) documentation which I'll get around to putting online properly sometime. Note that for all the code below, you are free to use it however you wish unless it says otherwise. This includes use as a component of a fully commercial application (I don't think there is anything here that could be sold by itself) and modification and subsequent redistribution (though it would be nice if you credited me with some of the work in that case.)
In addition to the code described below, I also have
a quick guide to getting the send command
working. This was condensed massively from the info available on
the WWW, and is a transcription of the sort of advice I've been giving
to people here with insecure displays when they were told to get
things working better (all in the name of stopping some users who like
xgrabsc and the like... )
The stuff below has been tested with Tcl7.4p3 and Tk4.0p3 and not with Tcl7.5b3 and Tk4.1b3 (with a few exceptions ) even though I have the newer versions installed locally. However, I only really anticipate problems with the directory browser, and then only on non-UNIX platforms (due to filename handling - this will take only a little work to correct, but I haven't had the time to do so yet).
I really ought to edit this page a bit more often. I'm now running Tcl7.6b1/Tk4.2b1 locally, with a copy of the most recent stable versions kept around for (semi-)supported software. I ought to go through and fix everything up here to work nicely with these new versions...
I've even been playing around with Tcl8.0 (nice one John) and much of the stuff here may well work with it. I've got a script lying around that really makes use of the compiling - it isn't worth running without compilation, it uses so much math processing! I'll shove it somewhere on here when I have a few moments.
There is no help for getting things installed, as my local installation is somewhat wierd anyway...
Users of Internet Explorer should note that it is incapable of handling double extensions. As a work-round, they can substitute .tgz for .tar.gz anywhere they wish when downloading from this page.
Personally, I'd recommend that they use Netscape instead, but that's a separate matter entirely...
Users of GNU Emacs v19 and v20 are well served by context-sensitive highlighters in C modes and the like, but the default highlighting for Tcl is of little use, offering little real assistance to the developer. In response to this, I had developed a set of highlighting expressions for use in Emacs, but these were unfortunately based on the now-deprecated hilit19 package. Luckily, I've now converted these to work with the font-lock package with the same look and an improved feel over the original. Get the elisp implementation of this and then install it by:
Putting it in a directory on your load-path (I use $(HOME)/emacs)
Byte-compiling it (not strictly necessary, but a good idea)
Adding the line
to your $(HOME)/.emacs
Once this is done, the next time you load a Tcl file (there are plenty below) after you have restarted emacs, you will get loads of glorious highlighting.
Note that if you use a dark-background for your emacs windows, the highlighting will not be very effective (I'm a light-background person), but this is easy to fix by modifying all the font-lock-make-face lines near the head of the elisp file.
Some people have had problems with this library due to their using older versions of emacs. For these people, I make available a version of the above highlighting which uses hilit-19. This version is unsupported, but is the direct ancestor of the later code that works with Font-Lock mode.
The code has now been adapted for emacs v20 while still maintaining backward compatability (crucial for my own use!) There is still more work to do though, since I feel that the faces ought to be customisable. That is a lot of effort though, so I'm putting it off as much as I can...
Shaped Window Extension
Notebook Container Megawidget
Font Selection Dialog
Advanced Error Dialog
Transparent Photo Images
|My Generic Useful Library.||Gzipped tarfile.|
|Canvas Dump/Undump Procedures.||Tcl script.|
|Image Pane Generation Procedures.||Tcl script.|
|Try/Catch/Finally Command.||Tcl Script.||Tcl8.0 and later Only|
|Fully Justified Text Demo.||Tcl Script.||Tcl8.0 and later Only|
|A full OO extension.||C source.||Tcl 8 (betas) Only|
|A full OO extension.||Gzipped Tarfile of Sources.||Tcl 8 Only|
|Alternative version.||Zip Archive of Sources.||Tcl 8 Only|
Small C Extensions including...
|Adjustable fonts in the standard message dialog.||Patch to Tcl script.||Tk8.0/Unix Only|
Some fun tclets I've written:
Some games I've written:
A game I've cobbled together (sorry, but it isn't a Tclet at the moment. You'll need to save this one to a file and run it from there...)
Use the cursor keys move (left/right turns, and up goes forward) to seek out the beings moving within the maze. However, you only gain points for the being you're currently seeking, meet any others and you lose points and suffer the indignity of a teleportation to some random location...
16 Aug 2000 - Updated to use a faster maze generation algorithm. If only I had a heartbeat sound, I'd add in support for claustrophobic heartbeats to indicate the distance to the nearest being (if Snack is an available package.) Oh well...
25 Aug 2000 - Updated to use a more natural way of viewing the maze (i.e. I took the time to do the geometry.) The maze is also smaller now, so it is easier to find other beings to interact with.
A client/server version of the maze explorer which allows several people to explore the same maze at the same time. Also includes a basic messaging facility so that players can communicate with each other. Alas, I've not yet made the client version into a Tclet. I plead lack-of-time...
You need to fill in the host and port-number when the program starts; I've not yet put in support for setting that sort of thing from a configuration file, command line or Tclet embedded argument...
25 Aug 2000 - The same fix that I applied to the stand-alone version has also been added here.
27 Aug 2000 - Added some path tracking graphics, and improved debugging too!
Also added protocol versioning and visited location support to the client/server version.
A computer-controlled player to go with the above server/client code.
30 Aug 2000 - Oops! Removed a typo. That'll teach me to add changes at the last minute...
Now you can try your hand at exploring a pre-built maze from the safety and comfort of your web-browser. Note that you can view the source of the tclet too to reassure yourself that nothing untoward is happening in the downloading of active code from a site you don't necessarily trust. Alternatively, just connect the client to the host athene.cs.man.ac.uk, port 20202.
Any further ideas for what to do? Contact me!
For those interested in playing with trains (and also if you lack access to the standard X bitmap program,) I've written a little script that animates a few trains drawn using bitmap images.
If you have any problems, mail me and I'll see what I can do to help you out.
About this page.