> Hi Bruno,
>
> Thanks for your answer but I still dont get it for the following
> reason. The script is not supposed to update the GUI. The GUI is just
> sitting there waiting. So, in theory the GUI doesnt need re-rendering.
> It's MATLAB that gets messed-up.
No. Graphic objects are created as small rectangle "standalized" across softwares and handled by OS (all graphic objects of Windows are rectangular shape, that why the OS is called WINDOWS). OS are responsible to issues "Events", and software (MATLAB) are (could be) responsible for refreshing the button when an event is received from OS. Software does not when their buttons are hidden by a Browser. And when the Browser moves out "someone" must refresh the button. Who is "someone"? It could be OS or Matlab, depending on the Event Callback is captured or not.
In principle, how and how often the Events are proceeded is managed by a default scheme that works all right for most of the cases. However your script, even if it does not work directly with GUI, can disturb the timings of the graphical refreshing, and you should be aware about it, and take an appropriate action when you are putting your code together with GUI. This phenomenon is problematic for Windows based software, which is historically is a mono-thread OS.
Bruno