Chapter 4. Creating Scripts

Table of Contents
The OPTIONS section
The VARS section
TOOLBAR sections
Command lists
Built-in Commands

Lortug uses script files to describe the layout of the toolbars it is to create and the commands attached to the toolbar components. Examples of these script files are located in the samples directory in the distribution and are copied to (prefix)/share/Lortug/samples during installation. The sample scripts contain comments explaining what they do.

Script files can be broken down into the following section types:

With the exception of NEW ROW all the sections being with BEGIN [section type] and end with END [section type] (ie BEGIN OPTIONS). The script file parser is CASE SENSITIVE, so make sure that the BEGIN/END and section type names are capitals. Each command in a script file must be on its own line. Commands can be split onto multiple lines by using the \ continuation character at the end of the line. There can be only one each of the OPTIONS and VARS sections but as many NEW ROW commands and TOOLBAR sections as one wants in a script file. Comments can be placed in a scriptt file using the # character, when this character is encountered the parser will ignore the rest of the line.

The OPTIONS section

The OPTIONS section sets lortug options that affect all toolbars. The possible options are:

The following example sets the toolbar orientation to vertical, adds /usr/local/share/pixmaps and /usr/share/pixmaps to the icon search path, tells lortug to save and restore the value of variables foo1 and foo2, sets the window title to "Lortug Example" and sets the window position to (200, 100).
BEGIN OPTIONS ORIENTATION = VERT ICON_PATH =
/usr/local/share/pixmaps:/usr/share/pixmaps SAVE_VARS = foo1 | foo2
TITLE = Lortug Example POSITION = 200+100 END OPTIONS
			
Note that the indenting in the example above is only done for aesthetic reasons, lortug itself doesn't care about it.