multiple instances of gui open at once
Show older comments
Hello,
I created a GUI that asks the user for several parameters before running a model. I give the user the option to save a specific run to use later. I use the hgsave(filename) function. But when the user opens the saved run, 3 instances of the GUI appear.
I can just close 2 of them and the 1 works fine, but I'd really like to stop 3 from appearing before giving the model to my users. Anyone have any ideas? I don't even know where to start debugging this problem. I never had this problem in R2014a but since graphics handles were changed to objects (R2014b or higher), I have duplicates
Thanks
5 Comments
Adam
on 26 Oct 2015
You'd have to give more details of your code. I have never used hgsave myself but I see nothing in its help to suggest that this would be its normal behaviour so it must be something in your specific code that uses it.
MCM
on 26 Oct 2015
Jan
on 26 Oct 2015
@MCM: It is impossible to guess the reason of your problem based on this information. Anywhere in your code are the commands, which open 3 figures. We cannot guess what "save a specific run" means.
MCM
on 26 Oct 2015
Jan
on 26 Oct 2015
Why do you save the complete GUI? It sound like you want to save the value of the UICONTROLs only. You observe the side-effects and they disturb you. So avoid the side effects by choosing a method, which does not have it: Save the user-defined values of the uicontrols only.
Answers (2)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!