- Report the bug! :)
- Or... you can create your own graphic menu, controlling your tab object programmatically. For example... in the image below there is a tab object in the background.
Menubar hides and reappears at startup of App Designer App.
5 views (last 30 days)
Show older comments
Hi,
Whenever i try to start an app which has a menubar, the menubar dissappears for less than a second and then reapears.
Is there any way to fix this?
Code:
classdef app1 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Menu matlab.ui.container.Menu
Menu2 matlab.ui.container.Menu
TabGroup matlab.ui.container.TabGroup
Tab2 matlab.ui.container.Tab
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 640 480];
app.UIFigure.Name = 'MATLAB App';
% Create Menu
app.Menu = uimenu(app.UIFigure);
app.Menu.Text = 'Menu';
% Create Menu2
app.Menu2 = uimenu(app.UIFigure);
app.Menu2.Text = 'Menu2';
% Create TabGroup
app.TabGroup = uitabgroup(app.UIFigure);
app.TabGroup.Position = [1 1 640 480];
% Create Tab2
app.Tab2 = uitab(app.TabGroup);
app.Tab2.Title = 'Tab2';
% Show the figure after all components are created
app.UIFigure.Visible = 'on';
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = app1
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end
0 Comments
Answers (1)
Eric Delgado
on 19 Sep 2022
It's a bug. So... there are two ways to deal with it:
0 Comments
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!