MATLAB Creating Graphical User Interfaces

(ff) #1

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.


How Menus Affect Figure Docking


When you customize the menu bar or toolbar, you can control the display of the window's
docking controls by setting the DockControls property. You might not need menus for
your app, but if you want the user to be able to dock or undock the window, it must


Create Menus for Programmatic Apps
Free download pdf