Borrar filtros
Borrar filtros

How can I delay the display of a GUI?

3 visualizaciones (últimos 30 días)
Canoe Commuter
Canoe Commuter el 6 de Feb. de 2013
I want the GUI to wait a few seconds after the program is launched before it appears on the screen. Here's why:
I have developed a GUI with GUIDE. My GUI has a splash screen (which I got from File Exchange - thanks Ben Todroff!). The splash screen is shown for three seconds, but right after it appears, the GUI appears and is displayed on top, so you can't see the splash screen.
I've tried sticking a uiwait command in a few places in the GUI, such as in the OpeningFcn function, but it hasn't done anything. I assume a timer object could also be used, but I don't know where to put these things in the GUI file.
Alternately, if it's easy to force the GUI to display UNDER the splash screen, that would be acceptable.
Can anyone help? Thanks!

Respuestas (1)

Sean de Wolski
Sean de Wolski el 6 de Feb. de 2013
I would pull all of this outside of GUIDE and just have the timer open your GUIDE GUI/splashscreen etc.
function openingExample
h = figure;
T = timer('Period',1,... %period
'ExecutionMode','singleShot',... %{singleShot,fixedRate,fixedSpacing,fixedDelay}
'BusyMode','drop',... %{drop, error, queue}
'TasksToExecute',1,...
'StartDelay',2,...
'TimerFcn',@openAndClose,...
'StartFcn',[],...
'StopFcn',[],...
'ErrorFcn',[]);
plot(1:10); %splash screen!
drawnow;
start(T);
function openAndClose(~,~)
close(h); %close splash
untitled; %Name of your GUIDE GUI ( I keep untitled around)
drawnow;
end
end

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by