MATLAB: Question about uiwait – Unwanted beep when passing to a second modal GUI

guimodaluiwait

I have two GUIs. Pressing a button on my first GUI leads to a second GUI that is modal, pauses the first GUI with uiwait, and requires that the user answer a yes or no question in the second GUI before the window closes and resumes the first GUI with uiresume. So the code for the button callback in the first GUI looks something like this:
SecondGUI
uiwait(gcf)
% more code
And the code for the callback of either of the two buttons in the second GUI could look something like this:
% code
uiresume(gcbf)
close
Because the second GUI is modal, once it is activated, performing uiwait in the first GUI produces an unwanted beep. Is there a way around this, or do I just have this conceptually all wrong?

Best Answer

Modal dialogs effectively do their own uiwait()