# AppGuru templates

A template is a save file from WorkShop Visual, combined with a set of resources in the WorkShop Visual resource file. The save file specifies what is in the template, and the resources specify what can be done to the template within AppGuru.

In the WorkShop Visual resource file, there is a section devoted to AppGuru templates. This specifies which tempaltes are available, the files in which they are contained, and what components within these templates are removable.

To create your own template, create a file which contains everything you will want to put into it, and then change a resource file which will be available to WorkShop Visual at startup so that it kmows about the template. So, for example, if you wanted to make a tempalte available to all users or your WorkShop Visual installation, you might change the resource file for WorkShop Visual in the installation itself, whereas if you only wanted to use the template yourself, you would change your `~/.Xdefaults` file.

## The AppGuru resources

The visu.templates resource lists the available templates in a comma-separated list. Each template has a name here, which is used as a key to look up other resources relevant to that template.

These resources are as follows (replace template with the name of a template or component with the name of a component to get what you would see in the resource file):

`visu.tm_appguru_menu*`template.`labelString`
  This resource defines the name of the template as it will appear in the AppGuru menu, which is accessed from the Tools menu in the WorkShop Visual main window.
`visu.`template`.saveFile`
  This resource tells AppGuru where to find the save file which contains the save file on which the template is based
`visu.`template`.template`
  This specifies the list of components in the template. A component is a part of the template which can be included or elided depending on the setting of its associated toggle. Each component is represented by a pixmap (in the pictorial representation of the template) and a toggle button for specifying whether the component should be included or elided.
`visu.`template`.pixmapDirectory`
  This tells AppGuru where to look for the pixmap files which are used in creating the pictorial representation of the design. It is a standard path, and can include environment variables.
`visu.`template`.`component`.toggleLabel`
  This specifies the name of a particular component; it is use to provide a text label for the toggle which controls the inclusion/omission of the component.
`visu.`template`.`component`.pixmap`
  This specifies the pixmap which is used within the template to represent the component; it takes the form `x, y, width, height, filename`, where `filename` is relative to the pixmap directory described above.
`visu.`template`.`component`.widgets`
  This specifies the list of widgets which make up this component - it takes the form of a comma-separated list.
`visu.`template`.extraPixmaps`
  Most templates are composed of a design in which not all widgets are components that the user might want to filter out. For example, the default template has a main window, a number of components which can be used within it, and a number of utility dialogs. The main window is always present in any design generated from this template. The extraPixmaps resource specifies the pixmap(s) which are to be used to represent the non-filterable components. The format is `x, y, width, height, filename, x, y, width, height, filename, ...`

See also:

- AppGuru
- About WorkShop Visual