This page last updated 13 December 1997

Waiheke Paul's Tcl/Tk Pages


GET YOUR Tcl/Tk Plugin HERE -- FREE!

These pages require a VERY recent version of the Tcl Plugin
This spot should be green if you have the latest  version; 
Otherwise download it.
This music has been omitted
Thank you J S Bach for Bwv1052 mov 1. 
Midi file copyright of Paul Nash 1996. 
Permission to copy granted for non-commercial use only. 
Tcl has been around for many years, but is "coming of age" now that it is available on a range of PC platforms as well as UNIX platforms and has a plugin for Web browsers which allows you to write code inline as easily as Java, or HTML itself. A lot of simple Web jobs can now be done using Tcl much better than was possible before using GIFs and other files. These pages make it even simpler because the Tcl painters in these pages let you design what you want and the painter writes the tcl code for you. YOU DONT HAVE TO WRITE A THING! 

Tcl/Tk consists of two separate parts. Tcl is a simple scripting language, similar to the UNIX shell language. Tk is an add-on to Tcl which looks just like the Tcl language and provides facilities for Graphical User Interfaces, GUI's, of which a homepage is a prime example. In these examples we will be mainly using the Tk commands, and using Tcl where necessary. The Tk commands are used to define objects(widgets) on the screen, such as frames and labels. 

Simple coloured horizontal rules are the first simple objects which you can add to your page instead of using GIF images. GIF images range in size from about 1kb thru to 5kb and more. These can be replaced by a short line in Tcl which can easily be modified to give you the length you want, the precise colour you want or the width you want. 

These simple rules need about 50 bytes! An enormous saving in your storage space, your homepage space and download time. Whats more you can tailor your horizontal rule to suit so easily. You dont have to keep a large directory of line.gif's of different colours just in case you might need them someday. Nor do you need to load a line.gif into a painter to change its colour and store it again, you can just adjust the description in your HTML code. 

For those who have been here before and know what you want, here is a directory of painters. 

A single textured tile 

A row of identical frames 

A row of nested frames 

A row of doubly nested frames 

A row of alternating frames and a row of alternating nested frames 

Checkerboard layout 

A graded colour bar 

A label design painter 

An animated checkerboard 

The Distributed Tcl Library

Residents of WestHollywood, such as myself, like to use the rainbow flag in our homepages. You too may have some simple logo which you like to display. Maybe, like residents of WestHollywood, you also find that your logo takes so much time to download that it degrades the performance of your homepage.
The rainbow flag and the rainbow ruler(above) are prime examples of the power of Tcl to deliver what you want at minimal cost. The particular rainbow rule shown here would tend not to be used because of the impact it would have on the performance of a homepage. Instead residents of WestHollywood have tended to make do with rulers such as this next one.
A flag is in many cases a wide short ruler. It was the rainbow flag to the right that inspired the horizontal rule above. They can be grouped together with rulers as a class of simple Tcl objects which can be used on your homepage. To see more examples of simple horizontal rules and the code to create them visit the RULE PAGE.
If you have visited the RULE PAGE you will already have seen some lines that look almost like boxes. Yes, you can put fancy coloured boxes around your text at next to no extra charge. 

Unfortunately, the Tcl plug-in is a castrated version of Tcl. It has had all its naughty bits that could upset your computer system cut off. This includes reading and writing files, such as .bmp, .gif, .jpg, that could make the appearence of your Tcl components more subtle. In spite of this there are a lot of shading effects that you can acheive. To see some of these have a look at this second page of rulers made using Tcl/Tk labels

This Leather flag and the horizontal rule are two more logos familiar to WestHollywood residents. These look rather similar to the rainbow logos above, but, because of the heart-shape, they have to be implemented with one of Tk's most powerful and complex commands "canvas". 

The CANVAS page shows you some of the new things you can do using the canvas widget.
So far I have concentrated on static images, but the Tcl language makes available a whole new area of interest, ANIMATION! Animated .gifs are very useful, while they are small, and where the animation is passive. 

Tcl animation is best used where the image is large and graphic. Colours can be changed, shapes can be altered, objects can be moved, all within the confines of the Tclet window. 

This movement can be program or user defined. That is, the window can be "live" to the viewer, allowing all sorts of interaction to occur. Click here for some basic examples

Safe Tcl

Safe Tcl cannot do certain things. It is helpful when writing tclets to know what these things are-

glob doesnt work.

File read and write requires "policy home". 

Because Microsoft IE requires the presence of a SRC option with a .tcl suffix in order to fire up the Tcl Plugin, this makes things difficult for those Microsoft IE uses and those who wish to cater to them. I personally couldn't give a toss. I go with the leading edge. However by using "short.tcl" hosted at "" you can still run Tclets. The painters on these pages produce code which uses this technique for invoking tclets. 

This is adequate for most casual web-page uses, if not entirely desirable from's point of view. 

Return to Yhek's Homepage.  © 1997 
Check out other graphics oriented sites here.

Next 5
This Eye-Candy Ring site owned by

This page hosted by GeoCitiesGet your own Free Home Page