uimenu
Create a menu or menu item graphics object.
📝Syntax
m = uimenu()
m = uimenu(parent)
m = uimenu(propertyName, propertyValue, ...)
m = uimenu(parent, propertyName, propertyValue, ...)
📥Input Arguments
Parameter Description
parent Figure, context menu, or menu graphics object. When omitted, the current figure is used.
propertyName Property name: a scalar string or row vector character.
propertyValue Property value compatible with the property name.
📤Output Arguments
Parameter Description
m Menu graphics object.
📄Description

uimenu creates a menu in a figure menu bar, a submenu, or an item in a context menu depending on the parent.

The Text property controls the displayed label. Ampersand characters are preserved so the native toolkit can expose keyboard mnemonics.

The Position property orders sibling menu objects. The Children property lists menu children in the graphics object hierarchy.

See uimenu properties for the complete property list.

💡Examples
Create a figure menu.
f = figure();
fileMenu = uimenu(f, 'Text', '&File');
uimenu(fileMenu, 'Text', 'Open', 'Accelerator', 'O');
uimenu(fileMenu, 'Text', 'Checked item', 'Checked', 'on', 'Separator', 'on');
🔗See Also
uimenu properties
Edit this page on GitHub