MATLAB: How to add or remove the menubar or toolbar from a figure in MATLAB
addchangefigureMATLABmenubarnoneremovetoolbar
How can I add or remove the menubar or toolbar from a figure in MATLAB?
I want to control whether the menubar and toolbar appear in a figure. Can I turn them on or off?
Best Answer
You can use SET command to change the MenuBar and Toolbar properties of the figure to control whether the menubar and toolbar are shown in a MATLAB figure.
The possible values for Menu Bar are:
'none' - the menubar is not shown
'figure' - the menubar is shown
The possible values for ToolBar are:
'none' - the toolbar is not shown
'auto' - the toolbar is controlled by the menubar.If MenuBar is set to 'figure', then the toolbar is shown.If 'MenuBar is set to 'none', then the toolbar isn't shown.
'figure' - the toolbar is shown
For example, the following code will open a figure without the menubar and toolbar:
when uimenu (undo redo) callback goes to undo or redo functions, the parent of the hObject is uimenu and not the figure itself. The parent of uimenu is figure. which means if you want to call figure, you have to write
hObject.Parent.Parent
so when you call
entries=hObject.Parent.UserData;
for uimenu, the parent is uimenu and not the figure while for buttons of redo and undo the parent is figure itself
Best Answer