How to avoid Globals on a code created (complex) Figure?
Afficher commentaires plus anciens
Dear experts,
I am creating a GUI using pure code (without Guide). When we use Guide, we have the Handles variables that it is an input of ALL Callback functions, working similarly to a Global, since the alterations on this variable are automatically considered by other callbacks, I believe the magic is in the lines:
handles.output = hObject;
guidata(hObject, handles);
added at the end of each Callback functions that modified the handles variable. Am I right? How I use something similar with my GUI project? (I am seduced by the idea of adding the Handles as Global, but I am trying to be strong here)
I already define the callback functions on my uicontrol objects, created the functions and etc. I tried to add a created "handles" variable into the MainFigure "UserData" but this does not work since neither the Figure object is recognized by the callbacks.
THANK YOU VERY MUCH IN ADVANCE!
1 commentaire
"I believe the magic is in the lines:"
Magic is not involved:
Reading the documentation is involved.
Réponse acceptée
Plus de réponses (1)
Elias Gule
le 18 Jan 2018
1 vote
Catégories
En savoir plus sur Graphics Object Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!