Re: timers and event loops
Re: timers and event loops
- Subject: Re: timers and event loops
- From: William Turner <email@hidden>
- Date: Tue, 29 Nov 2005 10:57:37 -0500
Hi Eric,
Thanks for the response. In order to get the timer to fire both when
the menus are open and when they are not, I installed it in both the
default and the event track mode - is there any problem with
installing a timer in multiple modes?
Thanks,
Wil
On Nov 29, 2005, at 10:32 AM, Eric Schlegel wrote:
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