필터 지우기
필터 지우기

Alternative to waitfor? Need menu functionality using dialog but waitfor freezes everything until the GUI is closed.

조회 수: 5 (최근 30일)
Using R2012b I've previously created a GUI menu using "menu" but that has limitations (cannot group multiple choices into a dropdown) and also it's not recommended - dialog is recommended instead for multiple choice dialog boxes. See http://www.mathworks.com/help/matlab/ref/menu.html and http://www.mathworks.com/help/matlab/ref/dialog.html for reference.
dialog is working fine for me except for the waitfor. Using menu, I'm able to have my GUI menu, choose a selection that plots something for instance, and go back to my GUI menu where I'm waiting for another user input. But I'm not locked out of clicking on my plot(s) and moving them around, etc. However, recreating this GUI menu using dialog and uicontrols (which does allow me to group items in drop down menus so that's good), I'm forced to using waitfor to stop execution and wait for the user input. The bad thing is, everything else in MATLAB is locked out too - if I try to click on those plots to bring them upfront or move them, it just dings. Menu didn't do this - it allowed me to access those plots while still waiting for a user input.
How can I get this functionality back using dialog/uicontrol? Is this something to do with modal vs. non-modal?

채택된 답변

TastyPastry
TastyPastry 2015년 10월 9일
Try changing the 'WindowStyle' property to 'normal'. The default for dialog() is 'modal', which means the dialog box created is always on top of the other GUI windows and makes the other windows inaccessible.
  댓글 수: 1
Thrashercharged
Thrashercharged 2015년 10월 9일
That did it! Thanks! It's frustrating that MATLAB recommended that dialog be used instead of menu but doesn't clearly document how to make them behave the same, and all my web searching couldn't turn up this answer.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by