I am working on a MATLAB GUI where I have to show a progress bar. I have two problems with the waitbar function:
-
I want to make the progress bar modal, so that user can’t do any other thing on the GUI while the progress bar is shown.
-
There is the minimize button and the close button at the top right corner of the bar (pretty much like any other window). If you press the close button, the progress bar closes, I want this button to be hidden or disabled so that the user can’t close the bar.
How can I implement these behaviours?
Example:
By setting
CloseRequestFcnto empty string, clicking the close button will do nothing. You just have to wait for the loop to finish.Note that you can still hit Ctrl+c to kill the running computation (which I think is a good thing, you don’t want to annoy the user after all!)