• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: timers and event loops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: timers and event loops
      • From: Ricky Sharp <email@hidden>
References: 
 >timers and event loops (From: William Turner <email@hidden>)
 >Re: timers and event loops (From: Eric Schlegel <email@hidden>)

  • Prev by Date: Core data accessor and KVC
  • Next by Date: Re: timers and event loops
  • Previous by thread: Re: timers and event loops
  • Next by thread: Re: timers and event loops
  • Index(es):
    • Date
    • Thread