next up previous index
Next: Event Handling Up: Using Tcl/Tk from Previous: Structuring Tcl/Tk Code

General Advices

Define right at the beginning what will be executed by Tcl/Tk and what by Prolog. It pays off doing some data processing in Tcl, e.g. checking the validity of input data or event handling locally in a widget. This reduces the communication between Prolog and Tcl and this makes the application more transparent and manageable.

When writing ProTcXl code, first write the Tcl/Tk scripts which define the widgets, their geometry and the functionality which will be executed by Tcl/Tk. Use the programs wish or tclsh to prototype these scripts and do not insert any ProTcXl - specific code until everything else is written and debugged.

When this Tcl/Tk code is written and debugged, start writing the Prolog file which interfaces it: loading the library, initialising ProTcXl , sourcing all Tcl scripts. After that you can start with event handling and calls between Prolog and Tcl/Tk.



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