Next: Toplevel windows Up: Advanced features Previous: Advanced features

## Templates

XF provides the concept of templates. Templates are files which contain Tcl/Tk code defining a widget structure and/or procedures (stored as Tcl/Tk code). A template can be loaded by the user, adding this widget structure and/or functionality to the application program. The inserted template behaves the same way as any other code written by the user. The user can change it, configure the inserted widgets etc..

The available templates are shown in the right list of the main XF window. By double clicking on a list item, the selected template is inserted. If the contents of a template have changed (e.g. when a new XF distribution is published), the template can be reloaded by inserting it again. This is only necessary when the old template was buggy, or the new template provides new functionality.

XF comes with a set of templates. There exist three main groups of templates named: Combined, Procedures and Widgets. The user can save widget structures and procedures as new templates. If a widget structure is temporarily stored to the cut buffer (with the cut/copy functionality), this widget structure can be saved with the menu item (Edit | Save Template (cut buffer)). It is also possible to interactively select procedures and a widget path to be stored to a template in the module structure dialog (Misc | Modules).

To reduce the size of the application program, it is possible to use a special type of templates. They are called autoloadable templates. This type of templates resides in a directory autoProcedures, where a tclIndex file can be found as well. All procedures defined in the templates are listed in the tclIndex file, and can be loaded automatically (using the Tcl auto load feature). The procedures are not saved when the program is saved. Instead the user has to add the pathname where the templates reside to the environment variable XF_LOAD_PATH. This variable contains a list of directory names separated by ``:'', where XF can find modules that are part of the application program.

Next: Toplevel windows Up: Advanced features Previous: Advanced features