A powerful public domain utility called Tcl/Tk (“Tcl and the Tk Toolkit”, John K. Ousterhout, Addison-Wesley, 1994) is coming into wide use as a command language and user interface builder.
This note describes three extensions to Tcl and the Tk Toolkit1 that enable Tcl/Tk applications to cooperate with Starlink applications. The extensions are:
The message system and notice board extensions are both based on work done by Dennis Kelly of the Royal Observatory Edinburgh.
A version of the Tcl shell (called atclsh) and the windowing shell (called awish) with all of these extension built in are provided which are useful for trying them out. However, for production systems, a bespoke version of the shell with a subset of the available extensions (both from Starlink and elsewhere) will normally be required.
The Starlink extensions can be built into a Tcl or Tk application by including one or more of the following functions in tclAppInit.c or tkAppInit.c.
Extension | Function | include file | object module |
Adam | Tcladam_Init(interp) | tclAdam.h | tclAdam.o |
Gwm | Tkgwm_Init(interp) | tkGwm.h | tkGwm.o |
Nbs | Tclnbs_Init(interp) | tclNbs.h | tclNbs.o |
where interp is a pointer to a Tcl_Interp. All three functions return a Tcl status value. The application should then be linked with the specified object module all of which can be found in /star/lib.
Alternatively, the Adam and Gwm extensions can be loaded at run time into the standard interpreters with load commands of the form:
The disadvantages of this method is the need to supply a path name for the shareable library which makes the script dependent on the location of the starlink software and that this mechanism may not be available on all operating systems in the future.
1These extensions will only work with Tk Version 4.2 or later