Scilab Function
Last update : 14/2/2006

uimenu - Create a menu or a submenu in a figure

Calling Sequence

h=uimenu([prop1,val1] [,prop2, val2] ...)
h=uimenu(parent,[prop1, val1] [,prop2, val2] ...)

Parameters

Description

This allows to create menus in a figure. If parent is a figure, then the menu item will be added to the menu bar of the figure. If parent is a menu item , then the new item will be added to the parent item, allowing to create cascaded submenu. To create a customized menu, you can use the properties listed below:

Properties

  • callback string: allows to set up the scilab instruction to call when the item is selected by the user.
  • label string: allows to set up the text appearing for the item.
  • tag string: this property is generally used to identify the menu. It allows to give it a "name". Mainly used in conjontion with findobj .
  • Examples

    
    f=figure('position', [10 10 300 200]);
    // create a figure
    m=uimenu(f,'label', 'windows');
    // create an item on the menu bar
    m1=uimenu(m,'label', 'operations');
    m2=uimenu(m,'label', 'quit scilab', 'callback', "exit");
    //create two items in the menu "windows"
    m11=uimenu(m1,'label', 'new window', 'callback',"xselect()");
    m12=uimenu(m1,'label', 'clear  window', 'callback',"xbasc()");
    // create a submenu to the item "operations"
    close(f);
    // close the figure
     
      

    See Also

    figure ,   uicontrol ,   set ,   get ,  

    Author

    Bertrand Guiheneuf