timer not always running
2 ビュー (過去 30 日間)
古いコメントを表示
I have an event listener callback. In that callback I run the following code:
disp('I ran')
t = obj.timer; %obj is instance of handle class
stop(t);
set(t,'TimerFcn',@(~,~)obj.resize2(h,event_data,axes_I,count,new_xlim,new_position));
start(t)
obj.timer = t; %Hold onto new timer so that it doesn't get deleted and executes
In resize2():
disp('I ran too!')
Previously I've done: t = timer; t.StartDelay = TIMER_START_DELAY; obj.timer = t;
I'm seeing code that indicates that the callback ran, but not the resize2() function. I'm seeing something like:
I ran
I ran
I ran
I ran
I ran too
I ran
I ran
I ran too
I ran
I ran
The way the callback code is setup, I want there always to be at least one call to resize2, following any calls to the callback. Any thoughts on why I am not seeing this?
Thanks, Jim
3 件のコメント
Geoff Hayes
2014 年 10 月 24 日
Hi Jim - That's an interesting approach which makes sense. I still wonder about the properties for your timer - how is it initialized (period, etc.)?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!