How to avoid Globals on a code created (complex) Figure?
Ältere Kommentare anzeigen
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 Kommentar
"I believe the magic is in the lines:"
Magic is not involved:
Reading the documentation is involved.
Akzeptierte Antwort
Weitere Antworten (1)
Elias Gule
am 18 Jan. 2018
1 Stimme
Kategorien
Mehr zu Graphics Object Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!