uimenu — Create a menu or a submenu in a figure
h=uimenu([prop1,val1] [,prop2, val2] ...) h=uimenu(parent,[prop1, val1] [,prop2, val2] ...)
integer Handle of menu's parent
string character name of a property to set up
scilab object value to affect to the corresponding property
integer handle of the corresponding menu
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:
String
Instruction evaluated by the Scilab interpreter when the menu is activated. Under MacOSX, the callback will not be executed for a "button menu" (a menu without children), you must specify at least a child.
{on} | off
Enable or disable the menu. If this property is set to
"on"
(default), the menu is operational, but if
this property is set to "off"
, the menu will not
respond to the mouse actions and will be grayed out.
{on} | off
Menu check indicator. Setting this property to "on" (respectively "off") places (respectively removes) a check mark next to the corresponding menu item. This option can be used to create menus that indicate the state of a particular option.
Please note that a standard menu (without the option "Checked" set) has no mechanism to become a menu which will be checked by a user action and conversely.
This property is ignored for parent menus.
[1,3] real vector or string
Foreground color of the uimenu (font color). A color is specified as Red, Green and Blue values. Those values are real in [0,1]. The color can be given as a real vector, ie [R,G,B] or a string where each value is separated by a "|", ie "R|G|B".
String.
This property represents the text appearing in the menu.
String
This property is generally used to identify the menu. It
allows to give it a "name". Mainly used in conjunction with
findobj()
.
{on} | off
Set the visibility of the uimenu. If this property is set to "on"
(default), the uimenu is visible,
but if this property is set to "off"
, the uimenu will not appear in its parent figure.
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',"clf()"); // create a submenu to the item "operations" close(f); // close the figure