MATLAB Runtime Server | ![]() ![]() |
Disabling Default Menu Options Selectively
You may want to take advantage of the built-in MATLAB tools for tasks such as printing the contents of figure windows that your application uses. This section describes how to include selected functionality from MATLAB figure menus in your own application.
You must disable these default menu options:
To use a menu bar on your own figure window that is a modification of the default menu bar:
figure('menubar','figure','toolbar','none') set(findall(gcf),'handlevisibility','on','serializable','on') m = get(gcf,'children'); figure('menubar','none','toolbar','none') copyobj(flipud(m),2) set(findobj(gcf,'label','&Edit'),'visible','off') set(findobj(gcf,'label','&View'),'visible','off') set(findobj(gcf,'label','&Insert'),'visible','off') set(findobj(gcf,'label','&Window'),'visible','off') set(findobj(gcf,'label','&Help'),'visible','off') set(findobj(gcf,'label','&New Figure'),'visible','off') set(findobj(gcf,'label','Pre&ferences...'),'separator',... 'off','visible','off') set(findobj(gcf,'label','Select && &Edit'),'visible','off') set(findobj(gcf,'label','Move &Camera'),'visible','off') set(findobj(gcf,'label','Camera &Motion'),'visible','off') set(findobj(gcf,'label','Camera A&xis'),'visible','off') set(findobj(gcf,'label','Camera Re&set'),'visible','off') set(findobj(gcf,'label','&Basic Fitting'),'visible','off') set(findobj(gcf,'label','&Data Statistics'),'visible','off') hgsave(gcf,'mymenufile.fig') close gcf; close gcf
You can also make other modifications using MATLAB layout tools, such as changing the callbacks for menu options that are not disabled, and adding new menu options of your own. See "Creating GUIs" for details on using the layout tools.
![]() | Preventing Command Window Input/Output | Providing a Way to Exit the Application | ![]() |