This page last updated
22 December 1997

Waiheke Paul's Line Bar Painters

If this spot is not green you may want to download the latest Tcl Plugin.
This is a window that generates a line of identical labels.

Driving Instructions

The label is "painted" using the formulae in the listbox center top, which can be selected by double-clicking on the chosen formula. The chosen formula then appears in the coloured listbox and becomes the surface-most in the label space. It starts out black, but you click on its formula in the coloured listbox to activate the colour bars for each formula.

The coloured list starts with two entries "border" and "1". "Border represents the label border and can be adjusted like any other frame border, for relief=flat,...,groove, colour and borderwidth. Relief and borderwidth apply only to the border and can be adjusted at any time.

The "1" is a formula representing the whole of the label space. It and all the following formulae in the list down to the last surface-most formula can be selected and adjusted for colour only.

If you discover that you have a redundant formula in the list, select it by clicking on it and use the "Delete Formula" button.

At any time you may adjust the width and height of the label image. These are often best kept equal to maintain a square, but all sorts of rectangles are possible and effective.

The library of funtions is both limited and fixed. It is limited to simple quarters and quadrants of the image space. It is also fixed in that the functions cannot be altered. You can however take this whole html page and put your own functions into the function listbox and experiment. Take care that the functions must be in a form acceptable to Tcl. Tcl's conventions are almost identical to the C conventions for expressions.

Response for selecting the formulae in the lists is about 1 second, so dont try to work fast with the painter. If you are using Windows 3.x the response can be a lot slower, presumably due to 32 bit emulation.

When you are done you can save the generated code in the Tcl Temp file named "labelbar.txt".

A few hints on how to make good designs:-

The formula library is sorted in order of how much of the image the formula covers. The first group cover half the image space, the next a quarter of the image space and lastly are some lines. It helps to follow a similar order when selecting formulae, unless you want to do some special masking, for instance, to get half a line.

New formulae are added at the end of the list only. I have not provided for insertion. If you do find you want to insert a formula then delete the top layers back to your insertion point and then rebuild them.

Use the mottled and dithered effects to advantage. Adjusting a colour by just 1 point can make for interesting changes in texture.

At present, the algorithm used to create the painter image is more sophisticated than the generated Tcl code, and so the picture you get from the generated code may not be quite the same as seen in the painter. I do not propose to remedy this. From my experiments, improving the general quality of the generated code does not improve performance significantly and so is not worth the programming effort. Even altering the generated code is seldom worthwhile. But if you feel the need, change the generated code. I have done so with the examples on these pages as a guide to the kinds of improvements you can make. The ways of improving the code are not obvious and there are traps for the unwary so a close inspection of the examples would be helpful.


Main Tcl page 1997 nzci@outnet.co.nz
This page hosted by GeoCitiesGet your own Free Home Page