MATLAB Creating Graphical User Interfaces

(ff) #1

For more information, see the DockControls, MenuBar, ToolBar, and WindowStyle
property descriptions on the Figure page.


Menu Bar Menu


The following statements create a menu bar menu with two menu items.


mh = uimenu(fh,'Text','My menu');
eh1 = uimenu(mh,'Text','Item 1');
eh2 = uimenu(mh,'Text','Item 2','Checked','on');


fh is the handle of the parent figure.


mh is the handle of the parent menu.


The Text property specifies the text that appears in the menu.


The Checked property specifies that this item is displayed with a check next to it when
the menu is created.


If your UI displays the standard menu bar, the new menu is added to it.


Create Menus for Programmatic Apps
Free download pdf