next up previous contents index
Next: How to ... Up: An O Tutorial. Previous: Example 3: Using

Example 4: Customizing the screen menu

First list all menus, then add menu 1 and 14 to the screen:

 
 O >  menu 
 As2> ? gives list of menu names
 As2> Major menu? (<cr> = refresh) ? 
 As2> Available menus:
 As2>   Assorted_1    Draw_Mol      O_heap_1      Sketch
 As2>   Lsq_align     Assorted_2    Map           Slider
 As2>   Refi          Lego          Manip         Bones
 As2>   Macro_2       Assorted_3    Sam           RSR
 As2>   O_heap_2      Paint_mol
 As2>   Trig          Assorted_4    Select        Symmetry
 As2>   Plot          Sequence      Utility       Patterson
 As2>   Mutate        Mask          Odalisque     Autobuild
 As2>   Mol_replace   Object_1      Object_2      Object_3
 As2>   Object_4      Object_5
 O >
 O >  menu ass_3 ;; 
 O >  write .menu junk.o ; 
 O >  $ cat junk.o 
.MENU                    T        19        12
Centre_ID   
Terminal_ID 
Wait_ID     
Stop        
Yes         
No          
Clear_flags 
Save_DB     
Id_reset    
Centre_atom 
Centre_Xyz  
Backup_DB   
Message     
Macro       
Draw_object 
Dial_last   
Dial_next   
Rotate_pictu
CPK_object  
 O >  $ vi junk.o

Here we edit the file, deleting some of the menu items. Notice that the number of lines in the datablock header must be changed, too. After editing, the file looks like this:

 
 O >  $ cat junk.o 
.MENU                    T        9        12
Centre_ID   
Stop        
Yes         
No          
Clear_flags 
Save_DB     
Id_reset    
Dial_last   
Dial_next

Read the .menu datablock back into the database, and redraw the menu:

 
 O >  read junk.o 
 O >  menu ; 
 O >