m = uimenu()
m = uimenu(parent)
m = uimenu(propertyName, propertyValue, ...)
m = uimenu(parent, propertyName, propertyValue, ...)
| 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. |
| Parameter | Description |
|---|---|
| m | Menu graphics object. |
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.
f = figure();
fileMenu = uimenu(f, 'Text', '&File');
uimenu(fileMenu, 'Text', 'Open', 'Accelerator', 'O');
uimenu(fileMenu, 'Text', 'Checked item', 'Checked', 'on', 'Separator', 'on');