uiwait(msgbox("My message") dialog comes up behind the app. User never sees it.
Mostrar comentarios más antiguos
Why does uiwait(msgbox("My message") dialog come up behind the app? My user never sees it so can't click OK. Is there a way to bring it to the front other than uialert() which is a lot more complex to program?
1 comentario
dpb
el 29 de Jul. de 2024
Make it modal should fix it.
Respuesta aceptada
Más respuestas (1)
Mario Malic
el 29 de Jul. de 2024
Editada: Mario Malic
el 29 de Jul. de 2024
Hi again,
I don't know if there is a better solution, but here is an example with uialert
Idea is to create a new figure with it, and once the button is pressed the figure will be deleted.
fig = uifigure();
% fig = uifigure("WindowStyle", "modal"); % Maybe this works better
uialert(fig,"File not found.","Invalid File", "CloseFcn", @(src, evt)delete(src));
while ishandle(fig) % wait for figure to be deleted
pause(0.1);
end
% rest of code
In case the figure shows behind the active window, try focus function, or
uifigure(fig);
Cheers
Categorías
Más información sobre Update figure-Based Apps en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
