next up previous index
Next: Joint Loading Up: ProTcXl 2.1 User Previous: Multi-architectural Installation

Using Tcl/Tk Extensions

  ProTcXl can also be used to interface various Tcl/Tk extensions. Similarly to plain Tcl/Tk, extensions must be loaded and initialised. The initialisation scheme of Tcl/Tk (as of Tcl 7.4/Tk 4.0) is unfortunately not quite straightforward, especially when several extensions are to be merged into one process. When a new Tcl interpreter is started, it calls the Tcl_AppInit   function which is assumed to initialise all new commands and data structures. There is one version of Tcl_AppInit   in plain Tcl, another one in Tk and yet others in each extension. Since one binary can have only one copy of this function, the user must decide right at the beginning which extensions will be used in the application, provide a Tcl_AppInit   function that initialises all these extensions and then link them all together to produce one binary program. With the ECLiPSe dynamic loading scheme it would be much more convenient to view each extension as a stand-alone unit and load and initialise it separately. As a matter of fact, for many extensions this kind of initialisation is possible and the user can thus decide which scheme fits better the particular application. We list below all alternatives which may be considered for extension loading and at the same time we use the Tree extension as an example. All cases assume that we have alredy successfully compiled and linked the extensions alone, with Tcl/Tk only.

The variety of special cases with completely different handling may seem confusing and indeed it is. To simplify it, please select the one case that fits your goals and your machine architecture and use it in your applications.

Tcl7.5/Tk4.1 will use a different scheme which is much more flexible, it allows to use shared libraries and define packages and it is thus likely that the way of loading and using extensions will be modified and simplified in the next ProTcXl releases.





next up previous index
Next: Joint Loading Up: ProTcXl 2.1 User Previous: Multi-architectural Installation



Micha Meier
Tue Jul 2 09:49:39 MET DST 1996