3

I have a very annoying problem with my matlab gui.

Once I start my program the gui can not be just send to the background, it pops up again an arbitrary number of times, until it decides to finally stay. I have to minimize it at least 10 times before it really stays there.

Is that a common behaviour? I have not modified anything of the gui initialization code, I basically just added a button to execute my function in a loop.

Any ideas are welcome!

cheers, Chris

Chris
  • 89
  • 2
  • 8
  • I also find this annoying, everytime a GUI element updates the GUI gets brought to the foreground. While typing in word and suddenly Im in my GUI I sometimes mess things up. This page is the only one I could find on the internet that mentions this problem, thanks for putting it up here. – Leo Oct 28 '15 at 13:20

1 Answers1

1

Yeah, I get annoyed by that too. You can hide the GUI (either within code or on the command line) with

set(myGuiFigureHandle, 'Visible', 'off')

and restore it with

set(myGuiFigureHandle, 'Visible', 'on')

which is fine in some situations, but not if the user simply wants to minimize for the time being. You could detect a minimize and hide, but then the figure window will disappear from the task bar, and the only way to restore its visibility is from code or the command line.

pancake
  • 3,232
  • 3
  • 22
  • 35
  • I am actually happy that is it not just me. I was wondering because google didn't reveal much help! Okay, this is at least some solution for me whilst programming, the users might not be too happy. Thanks for the quick response! – Chris Apr 09 '13 at 06:13
  • It is a good practice to initialize all your uicontrol's with Visible='off'. And, at the end of your code, you change the value to 'on'. You will avoid the blinking and achieve a better user-experience. – tashuhka Apr 09 '13 at 08:08
  • Nice workaround, its the only one I could find so far. – Leo Oct 28 '15 at 13:21