Effacer les filtres
Effacer les filtres

Reload a UIControl's value from .fig file

3 vues (au cours des 30 derniers jours)
David Wasserman
David Wasserman le 13 Mai 2020
Réponse apportée : Rik le 13 Mai 2020
My GUI has an edit control. When the GUI starts, the edit control shows the text specified as the 'String' property in the .fig file, which is '.6'. Later, the text may get changed. Can I put a statement in a callback function that will cause the GUI to reload this text from the .fig file? I don't want to use
set(hObject, 'String', '.6')
because the property may later get changed in the .fig file.

Réponses (1)

Rik
Rik le 13 Mai 2020
Why use a fig file to store data? You shouldn't be storing data in a fig file, just as you shouldn't be storing code in a mat file.
If you want a reset funcitonality you will have to make that yourself by storing the initial values during the startup.
I would encourange you to read this thread. You will also find an example of how to implement this in a class. How to implement it in a GUIDE-created GUI is a bit more tricky, as you'll have to hard-code which objects and parameters to store.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by