MATLAB: Stop bringing GUI to front

guiMATLABtext;

Hi,
I actually have 2 GUIs. One open in the front and another one running in the background. The GUI in the background shows an axes which displays a text that is rebuilt periodically. Every rebuild brings the GUI to front. How can I turn this off?

Best Answer

A figure is moved to the front if it is explicitly requested to do so. Perhaps there is a figure(figHandle); axes(axesH) in your code, which move the figure to front and code to activate the wanted axes. Then text() writes to the specified axes, but the lifting of the figure is not useful in your case. A solution would be then:
text(0.5, 0.5, 'Hello', 'Parent', axesH)
Specifying the parent cares for writing to the wanted axes also, but without moving the figure to the front.
So please check your code e.g. by using the debugger until you find the command, which causes the activation of the figure. Then remove this command and replace it accordingly.