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

dialogguiMATLABmenumodalnon-modaluicontrolwaitfor

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?

Best Answer

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.
Related Question