gui remembers old data
Mostrar comentarios más antiguos
A GUI application I wrote occasionally remembers old data (text edit entries, plots, etc) between uses even though I haven't designed it to do this. I've noticed that this can cause problems. The entries are there when the program is started or when I edit the gui in guide. Can anyone explain what is happening or how to stop it?
4 comentarios
Adam
el 26 de Feb. de 2018
Have you accidentally saved a running version of the GUI over the top of the .fig file?
Matthew Brehove
el 26 de Feb. de 2018
Matthew Brehove
el 26 de Feb. de 2018
Jan
el 26 de Feb. de 2018
This can happen, if you hit the save menu or have a saveas in your code. You can restore the original FIG file from your backup. You do have a backup, don't you? Under Windows try the "Recent Versions". Afterwards you can write protect the FIG file either by fileattrib or in your file browser.
Respuestas (1)
Jan
el 26 de Feb. de 2018
0 votos
Without seeing the code? This would be pure magic. How could the reader know, what happens? We can only guess. And so do I: You are using global variables to store data. These variables are not cleared between runs of the GUI.
Using globals is a very bad idea and they are known to confuse programmers with unexpected behavior.
But for a real and reliable answer, post the code.
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!