MATLAB Creating Graphical User Interfaces

(Barry) #1
Create Menus for Programmatic UIs

If you use the standard menu bar menus, any menus you create are added to it. If you
choose not to display the standard menu bar menus, the menu bar contains only the
menus that you create. If you display no standard menus and you create no menus, the
menu bar itself does not display.


Use the figure MenuBar property to display or hide the MATLAB standard menu bar
shown in the preceding figure. Set MenuBar to figure (the default) to display the
standard menus. Set MenuBar to none to hide them.


fh.MenuBar = 'figure'; % Display standard menu bar menus.
fh.MenuBar = 'none'; % Hide standard menu bar menus.


In these statements, fh is the handle of the figure.


Commonly Used Properties


The most commonly used properties needed to describe a menu bar menu are shown in
the following table.

Free download pdf