Accessing user variables from handles inside a timer function for a GUI
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dialog Boxes についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!