Re: timers and event loops
Re: timers and event loops
- Subject: Re: timers and event loops
- From: Eric Schlegel <email@hidden>
- Date: Tue, 29 Nov 2005 07:32:49 -0800
On Nov 29, 2005, at 7:00 AM, William Turner wrote:
I'm using an NSTimer to animate a scene in an NSOpenGLView. The
window contains a popup button and some other widgets. When the
popup button is pressed (exposing its menu), the animation stops.
This is true of any interaction with any of the widgets.
My suspicion is that the timer is not firing because the widgets
are interrupting the main run loop (on which the timer is registered).
Have other people encountered this and is there a standard approach
to dealing with it? I can put the timer in a different loop by
spawning a thread to manage it, but I'm curious to know if this is
the only (and best) way.
Menus use a different runloop mode from the default mode while the
menu is open, and your timer isn't installed in that mode, so it
doesn't run. Try installing your timer in the
NSEventTrackingRunLoopMode.
-eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden