Filter löschen
Filter löschen

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

5 Ansichten (letzte 30 Tage)
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?

Akzeptierte Antwort

TastyPastry
TastyPastry am 9 Okt. 2015
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 Kommentar
Thrashercharged
Thrashercharged am 9 Okt. 2015
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by