uiwait(msgbox("My message") dialog comes up behind the app. User never sees it.
Mostra commenti meno recenti
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 Commento
dpb
il 29 Lug 2024
Make it modal should fix it.
Risposta accettata
Più risposte (1)
Mario Malic
il 29 Lug 2024
Modificato: Mario Malic
il 29 Lug 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
Categorie
Scopri di più su Update figure-Based Apps in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
