Close uialert - App designer

31 visualizaciones (últimos 30 días)
Ali razi
Ali razi el 10 de Mzo. de 2022
Comentada: Walter Roberson el 12 de Mzo. de 2022
In App designer I have a function called
DayButtonPushed(app, event)
With the following code:
aFig = uifigure;
message = sprintf('March \n\nYear 2022');
uialert(aFig,message,'Info','Icon','info');
When I press the OK it does not close the background window. Therefore, how can I close all upon pressing ok (image attached)?

Respuestas (1)

Walter Roberson
Walter Roberson el 10 de Mzo. de 2022
Why create a uifigure() there? uialert() will create its own uifigure()
  6 comentarios
Simon Chan
Simon Chan el 12 de Mzo. de 2022
Add a CloseFcn may be a workaround if you don't want to use the uifigure anymore.
aFig = uifigure;
message = sprintf('March \n\nYear 2022');
uialert(aFig,message,'Info','Icon','info','CloseFcn',{@closefig,aFig});
function closefig(src,event,aFig)
delete(aFig)
end
Walter Roberson
Walter Roberson el 12 de Mzo. de 2022
@Simon Chan That's a good idea.

Iniciar sesión para comentar.

Categorías

Más información sobre Develop uifigure-Based Apps en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by