uiwait(msgbox("My message") dialog comes up behind the app. User never sees it.
Afficher commentaires plus anciens
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 commentaire
dpb
le 29 Juil 2024
Make it modal should fix it.
Réponse acceptée
Plus de réponses (1)
Mario Malic
le 29 Juil 2024
Modifié(e) : Mario Malic
le 29 Juil 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
Catégories
En savoir plus sur Update figure-Based Apps dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
