How to make a modal window generated during openingFcn on top of the GUIDE window

조회 수: 2 (최근 30일)
I have a logic to check something when a GUIDE window opens (in openingFcn) and if the check fails, display a warning modal window (warndlg). The GUIDE window is also a modal window. The problem is that since the openingFcn is called before the GUIDE window shows up and as a result the warning modal window shows up first, it will be behind the GUIDE window. A user has to move the GUIDE window around or close the GUIDE window to see the warning message, which defeats the purpose of a warning. Is there a callback for events such as window_opened in Matlab?

채택된 답변

Greg
Greg 2018년 6월 19일
편집: Greg 2018년 6월 19일
Use uiwait.
h = warndlg(. . .);
uiwait(h);
%%%These commands won't execute until warndlg is closed
%%%I.e., your GUIDE figure won't show up to block the warning
Using uiwait comes with other problems ( all of MATLAB is blocked until the warndlg is closed). I won't preach App Designer vs. GUIDE, but App Designer has solved these kinds of limitations with options such as uialert and uiconfirm.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by