Matlab App Designer: update fields in GUI from callback

2 visualizaciones (últimos 30 días)
JvdS
JvdS el 19 de Abr. de 2022
Respondida: chrisw23 el 20 de Abr. de 2022
I have created an app in App Designer. The Main app is called "app1.mlapp" and has a button which calls the second GUI called "PreferenceAppExample.mlapp".
I want to load the 2nd GUI from app1.mlapp by clicking the button "LoadNewWindow", this works.
Now the second GUI has options for a numeric field and a drop down list. Once I change the settings in the second GUI, I close it, and open it again. Then I see the values I just changed are restored to their default value. How do I get to see the latest selection of options?
The example is attached. Help would be appreciated.

Respuesta aceptada

chrisw23
chrisw23 el 20 de Abr. de 2022
Add a custom event to your app and send a notification to the calling instance when then app will be closed. You have the option to add any data to be saved (i.e. uicontrol states) to the event. When you reopen the app, you can initialize all uicontrols with the previously saved data.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by