extra uimenu in GUI figure (R2023b)

3 views (last 30 days)
Bruno Luong
Bruno Luong on 15 Sep 2023
Commented: Bruno Luong on 15 Sep 2023
Similar to this question about toolbar MATLAB R2023b inserts menu on my GUI figure any request.
For example the green one is mine, then MATLAB R2023 just puts their menus there (red).
I don't kow what else they mess with !
This is totally innaceptable. I must rollback to R2023a.
  3 Comments
Bruno Luong
Bruno Luong on 15 Sep 2023
Hi @Adam Danz, are you talking about the top GUIDE menu just bellow the figure name? See screen shot where I define only 2 menus in GUIDE
Bruno Luong
Bruno Luong on 15 Sep 2023
My workaround is to call this function to remove extra menu base of specific Tag
function RemoveMatlabToolbar(fig)
% RemoveMatlabToolbar(fig)
% Since R2023b MATLAB GUI add a separate toolbar in the figure
% Also a tone of menus
% If you don't want it, call this function in your OpeningFcn
try %#ok
if ~isMATLABReleaseOlderThan("R2023b")
h = findall(fig,'Type','uitoolbar');
Tag = get(h,'Tag');
b = strcmp(Tag,'FigureToolBar'); % This seems to be the default Tag of MATLAB toolbar
delete(h(b));
% filter out MATLAB menu
h = findall(fig,'Type','uimenu');
Tag = get(h,'Tag');
c = regexp(Tag, '^figMenu', 'once');
keep = cellfun('isempty', c);
delete(h(~keep))
end
end
end % RemoveMatlabToolbar

Sign in to comment.

Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!