Creating Graphical User Interfaces    

Defining Menus for the Menubar

When you create a menu, MATLAB adds it to the figure menubar. You can then create menu items for that menu. Each item can also have submenu items, and these items can have submenus, and so on.

Creating a Menu

The first step is to use the New Menu tool to create a menu.

Specifying Menu Properties

When you click on the menu, text fields appear that allow you to set the Label, Tag, Separator, and Checked menu properties as well as specifying the Callback string.

Adding Items to the Menu

Use the New Menu Item tool to define the menu items that are displayed under the menu.

The New Menu Item adds a submenu to the selected item. For example, if you want to add more items to the File menu in the illustration above, select File before clicking on New Menu Item again.

Laying Out Three Menus

The following Menu Editor illustration show three menus defined for the figure menubar:

When you activate the figure, the menus appear in the menubar.


 Creating Menus - The Menu Editor The Menu Callback