first previous next last contents

add_menu

add_menu name onval offval pos

Before adding commands to menus we need to create the menus themselves. The add_menu command does this. The menu name is the text to appear for the menu button. If this includes spaces it must be enclosed in quotes or curly brackets.

Onval and offval define the state masks for the enable and disable sets. Menus are always enabled whenever any of the items within them are enabled, even if the offval set defines otherwise. Menus are usually enabled at startup (onval == 1) and disabled during busy mode (offval == 2).

The pos argument may be either left or right. This requests the position to place the menu. Each leftwards positioned menu is packed to the right of the currently shown left menus. Hence the order in which menus are defined controls the order in which they will appear. Similarly for rightwards positioned menus.

So for example, the Gap4 main menus are defined as follows.

add_menu File           1 2 left
add_menu Edit           1 2 left
add_menu View           1 2 left
add_menu Options        1 2 left
add_menu Experiments    1 2 left
add_menu Lists          1 2 left
add_menu Assembly       1 2 left
add_menu Help           1 0 right

If more than one add_menu command is present for the same menu name the latter of the two takes priority.



first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.
URL: http://www.mrc-lmb.cam.ac.uk/pubseq/manual/scripting_11.html