Accessing user variables from handles inside a timer function for a GUI
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I created a GUI which has a timer function inside of it. I've initialized my GUI with some variables inside a struct called 'Vars', ie, MyGui(Vars);
Inside of my GUI.m file, I can access the 'Vars' variable inside the opening function by stating, handles.Vars = varargin{:};
Now all my functions have access to this 'Vars' structure however my timer never sees it being updated. I can access the 'Vars' structure as it was when the GUI initialized, but if I change anything inside of 'Vars', it isn't reflected inside the timer.
handles.timer1 = timer('TimerFcn',{@timerFunction,hObject,handles},'StartDelay',0,'ExecutionMode','fixedRate','BusyMode','drop','Period',0.2);
Then inside 'timerFunction', I access handles.Vars and it's the initialized version and not the current.
Inside of one of my functions I am performing guidata also,
handles.Vars.UseOffset = 1; guidata(hObject, handles);
Why can't I see the updated handles structure inside the timer function?
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!