MATLAB Creating Graphical User Interfaces

(Barry) #1

10 Lay Out a Programmatic UI


Create Menus for Programmatic UIs


In this section...
“Add Menu Bar Menus” on page 10- 66
“Add Context Menus to a Programmatic UI” on page 10- 73

Add Menu Bar Menus


Use the uimenu function to add a menu bar menu to your UI. A syntax for uimenu is

mh = uimenu(parent,'PropertyName',PropertyValue,...)

Where mh is the handle of the resulting menu or menu item. See the uimenu reference
page for other valid syntaxes.

These topics discuss use of the MATLAB standard menu bar menus and describe
commonly used menu properties and offer some simple examples.


  • “Display Standard Menu Bar Menus” on page 10- 66

  • “Commonly Used Properties” on page 10- 67

  • “How Menus Affect Figure Docking” on page 10- 68

  • “Menu Bar Menu” on page 10- 70


Display Standard Menu Bar Menus

Displaying the standard menu bar menus is optional. This figure’s menu bar contains the
standard menus.
Free download pdf