AppGuru templates

A template is a save file created by X-Designer, combined with a set of resources specified in the X-Designer 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 X-Designer resource file, there is a section devoted to AppGuru templates. This specifies which templates are available, the files in which they are contained, and what components within these templates are fixed, i.e. must always be selected.

To create your own template

  1. Start X-Designer
  2. Create a design which contains everything you will want to put into the template.
  3. Add the AppGuru resources to a resource file which will be picked up by X-Designer.

If you want to make the new template available to all users of your X-Designer on your system, change the resource file for X-Designer which is in:

	$XDROOT/lib/locale/YourLocale/app-defaults

where $XDROOT is the root of your X-Designer installation and YourLocale is the name of your locale( default "C").

If you only want to use the template yourself, change the file named .Xdefaults in your home directory.

Note - There are other ways of making the X Window System pick up resources for your application. You should refer to your system documentation to work out which method is best for you.


Resources Used by AppGuru

xdesigner.templates
This resource lists the available templates in a comma-separated list. Each template name is used as a key to look up other resources relevant to that template.
The resources for individual AppGuru templates are as follows (replace instances of template with the name of the template and instances of component with the name of a component in the template):
xdesigner.tm_appguru_menu*template.labelString
This resource defines the name of the template as it will appear in the "AppGuru" pull-right menu, which is in the "Tools" menu in X-Designer.
xdesigner.template.saveFile
This resource tells AppGuru where to find the save file which contains the template. This must be the full pathname. You can include environment variables; they will be expanded.
xdesigner.template.template
This specifies the list of components in a template. The list is comma-separated. A component is a part of the template which can be included or excluded 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 excluded.
xdesigner.template.pixmapDirectory
This tells AppGuru where to look for the pixmap files which are used in creating the pictorial representation of the design in the AppGuru dialog. This must be the full pathname and can include environment variables.
xdesigner.template.component.toggleLabel
This specifies the name of a particular component; it is used to provide a text label for the toggle in the AppGuru dialog which controls the inclusion/omission of the component.
xdesigner.template.component.pixmap
This specifies the pixmap which is used within the AppGuru dialog to represent the component; it takes the form x, y, width, height, filename, where filename is relative to the pixmap directory described above.
xdesigner.template.component.widgets
This specifies the list of widgets which make up this component - it takes the form of a comma-separated list. Usually this would be the root widget of the hierarchy for this component. Sometimes this might incorporate other widgets. In the default template supplied with X-Designer the "File Dialog" component includes the File Dialog itself together with the buttons in the "File" menu which have links to the File Dialog (the "Open", "Close" etc.)
xdesigner.template.extraPixmaps
Templates can include widgets which the user is not allowed 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: