| 
 |  | 
The commands on a menu, and the action performed when any command is chosen, are determined by the menu and menu_item clauses. These have the format:
   menu: menuname
   {
      menu_item clause
      ...
      menu_item clause
   }
Each menu_item clause contains a title clause specifying the name of the command, and a select_action clause specifying the action to occur when the command is chosen:
   menu_item
   {
      title=cmdname;
      select_action { script }
   }
Here cmdname gives the name of the menu command, and script is the action to be performed if it is chosen.
Instead of a script, the menu_item clause can reference a pull_off_menu clause, in which case choosing it displays the cascade menu of that name:
   menu_item
   {
      title=cmdname;
      pull_off_menu=name;
   }
For example, the Sort cascade menu would be defined by the following clause:
   menu_item
   {
      title=Sort;
      pull_off_menu=Sort_Cascade;
   }
The menu_item clause also has a short form, as follows:
   menu_item: cmdname
   {
      script
   }
This is equivalent to:
   menu_item
   {
      title=cmdname;
      select_action
      {
         script
      }
   }
See also: