uiwait(msgbox("My message") dialog comes up behind the app. User never sees it.
이전 댓글 표시
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개)
Mario Malic
2024년 7월 29일
편집: Mario Malic
2024년 7월 29일
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
카테고리
도움말 센터 및 File Exchange에서 Update figure-Based Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
