h = uimenu('PropertyName',PropertyValue,...)
hsub = uimenu(h,'PropertyName',PropertyValue,...)
uimenu
is a menu object creation function that accepts property name/property value pairs as input arguments. These properties are described under "Object Properties." You can also set and query property values after creating the object by using the set
and get
functions.
h
=
uimenu('PropertyName',PropertyValue,...)
creates menus that can perform a predefined action. These menus display along the top of the figure on a menu bar. Each menu choice can itself be a menu that displays its submenu when selected. h
is the handle of the created menu object.
hsub
=
uimenu(h,'PropertyName',PropertyValue,...)
creates a submenu of the parent menu specified by the handle h
. If you do not specify the handle of an existing menu, the current figure becomes the parent and the menu is a top-level menu.
Accelerator
Accelerator
.Accelerator
.BackGroundColor
ColorSpec reference page for more information on specifying color.ButtonDownFcn
eval
function to execute the specified function. Initially the empty matrix.CallBack
eval
function to execute the Callback
.Checked
on
Check mark appears next to item, indicating it is selected.off
(Default.) Check mark is not displayed.Children
Clipping
on
(Default.) Any portion of the menu outside the axes rectangle is not displayed.off
The menu is not clipped.Enable
on
(Default.) Menu item label appears dimmed, indicating you cannot select it.off
Menu label does not appear dimmed.ForeGroundColor
ColorSpec reference page for more information on specifying color.Interruptible
yes
The menu callbacks (ButtonDownFcn
and Callback
) are interruptible by other callbacks.no
(Default.) The menu callbacks are not interruptible.Label
Parent
Position
Position
property, with 1 representing the left-most position. The individual items within a given menu are placed from top to bottom according to the value of their Position
property, with 1 representing the top-most position.Separator
on
A dividing line is drawn above the menu item.off
(Default.) No dividing line is drawn.Type
'uimenu'
for a uimenu object.UserData
get
command.
Visible
on
(Default.) uimenu is visible on the screen.off
uimenu is not visible on the screen.
f = uimenu('Label','Workspace');
uimenu(f,'Label','Save','Callback','save');
uimenu(f,'Label','New Figure','Callback','figure');
uimenu(f,'Label','Save','Callback','save');
uimenu(f,'Label','Save','Callback','save');
'Separator','on', 'Accelerator', 'Q');
uicontrol
(c) Copyright 1994 by The MathWorks, Inc.