Accessing user variables from handles inside a timer function for a GUI

조회 수: 1 (최근 30일)
Thomas Marullo
Thomas Marullo 2013년 10월 9일
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개)

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by