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?
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!