| 1 |
This directory contains several sample tooltool specifications |
| 2 |
which you can use to help learn tooltool. All files ending in ".tt" |
| 3 |
are tooltool files. The samples contained herein are: |
| 4 |
|
| 5 |
lpq.tt |
| 6 |
queue.c |
| 7 |
laserwriter.icon |
| 8 |
This specification uses a custom application (queue.c) |
| 9 |
to show how a user could build a new windowed application |
| 10 |
from scratch using a small C program and a tooltool |
| 11 |
file. Compile queue.c (using "cc -O -o queue queue.c") |
| 12 |
and type "tooltool -f lpq.tt" to see the results. Lpq.tt |
| 13 |
creates a windowed print queue monitor which polls the |
| 14 |
print queue. Closing the window stops the polling, |
| 15 |
opening it restarts it, as do the buttons in the gadget |
| 16 |
panel. You can adjust the polling rate using the slider. |
| 17 |
|
| 18 |
lpq2.tt |
| 19 |
tty.c |
| 20 |
This is another queue tool, but written with all the |
| 21 |
smarts in the tooltool file itself. It uses /bin/cat |
| 22 |
to write to the display. This is a good example of |
| 23 |
the new features in tooltool 2.0. |
| 24 |
|
| 25 |
top.tt |
| 26 |
top.icon |
| 27 |
Top.tt turns the popular top command into a windowed |
| 28 |
application. Common top commands have been placed on |
| 29 |
buttons, and you can still type to top like you used to. |
| 30 |
|
| 31 |
rn.tt |
| 32 |
news.icon |
| 33 |
This turns rn, the news reading program, into a windowed |
| 34 |
news reading program. Again, common commands are on |
| 35 |
buttons, and less used commands are in a menu. You can |
| 36 |
add to or change rn.tt to suit your own tastes, depending |
| 37 |
on how you like to use rn. |
| 38 |
|
| 39 |
calc.tt |
| 40 |
This is the sample file discussed in the documentation. |
| 41 |
It uses very few tooltool options, and serves as a simple |
| 42 |
introductory example to tooltool. You could jazz this up |
| 43 |
with an icon, and some other buttons to perform other |
| 44 |
arithmetic operations. |
| 45 |
|
| 46 |
stopwatch.tt |
| 47 |
stopwatch.icon |
| 48 |
This creates a handy stopwatch tool, entirely within tooltool. |
| 49 |
It can count up or down, can take a split time, and can be set |
| 50 |
by clicking on the appropriate digits. It offers tenth or |
| 51 |
single second resolution. |
| 52 |
|
| 53 |
keytool |
| 54 |
keytool.r.14 |
| 55 |
keytool.defaults |
| 56 |
Keytool is a different kind of tooltool application. It is |
| 57 |
actually a shell script, which builds a specification for |
| 58 |
tooltool. It is a good example of how to process command |
| 59 |
line arguments for a tooltool application, and is a complex |
| 60 |
example of using tooltool. Basically, keytool lets you |
| 61 |
reprogram your keyboard, save those definitions and have them |
| 62 |
recalled when you next invoke keytool. To define keys and mouse |
| 63 |
actions, click shift-control-meta mouse right to see the |
| 64 |
programming window. Click on the key (and shift pattern) |
| 65 |
you want to define, and type the definition. A typical |
| 66 |
invocation would be "keytool /bin/csh" to create a shell |
| 67 |
window with programmable keys. Since keytool is a shell |
| 68 |
script, you invoke it directly, instead of using "tooltool -f |
| 69 |
keytool". Keytool is courtesy of Ken Laprade, here at Harris. |
| 70 |
Try it! |
| 71 |
|
| 72 |
Before using keytool, you must unpack the defaults and font |
| 73 |
files by typing: |
| 74 |
|
| 75 |
uudecode keytool.defaults.uu |
| 76 |
uudecode keytool.r.14.uu |
| 77 |
|
| 78 |
Then you can successfully run keytool. |
| 79 |
|
| 80 |
Note that keytool has its own special font, which you should |
| 81 |
install in /usr/lib/fonts/fixedwidthfonts if you make keytool |
| 82 |
an installed tool at your site. Don't forget to fix up the |
| 83 |
keytool reference to this font when you move it. The same |
| 84 |
goes for the keytool.defaults file, which we keep in |
| 85 |
/usr/local/lib. |
| 86 |
|
| 87 |
In all of these files, references are made to icon files, font files, and |
| 88 |
application names. If you wish to make these samples real commands, you should |
| 89 |
put the icons and associated files in a public place and modify the .tt |
| 90 |
file accordingly. At Harris, we put all .tt files in /usr/local/lib/tooltool, |
| 91 |
and icons go in /usr/local/images. The fonts used by these files are Sun |
| 92 |
standards, so that should be no problem. Finally, you should create little |
| 93 |
shell files to invoke tooltool transparently when the command name is typed: |
| 94 |
|
| 95 |
lpqtool: |
| 96 |
tooltool -f /usr/local/lib/tooltool/lpq.tt |
| 97 |
or |
| 98 |
tooltool -f /usr/local/lib/tooltool/lpq2.tt |
| 99 |
|
| 100 |
toptool: |
| 101 |
tooltool -f /usr/local/lib/tooltool/top.tt |
| 102 |
|
| 103 |
newstool: |
| 104 |
tooltool -f /usr/local/lib/tooltool/rn.tt |
| 105 |
|
| 106 |
calctool: |
| 107 |
tooltool -f /usr/local/lib/tooltool/calc.tt |
| 108 |
|
| 109 |
stopwatchtool: |
| 110 |
tooltool -f /usr/local/lib/tooltool/stopwatch.tt |
| 111 |
|
| 112 |
supershelltool: |
| 113 |
keytool /bin/csh |
| 114 |
|
| 115 |
Of course, replace /usr/local/lib/tooltool with the pathname of the place |
| 116 |
you keep the tooltool file. |