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!