• 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
[NEWBIE] Background tasks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NEWBIE] Background tasks


  • Subject: [NEWBIE] Background tasks
  • From: Brent Gulanowski <email@hidden>
  • Date: Tue, 28 Aug 2001 21:06:40 -0400

How does one get the event loop to give up a slice of processor time every
time through the loop? I'm thinking that overriding NSApplication's -run
would be way beyond me. Starting a new thread I think is also more than I
wanted right now, but if that's what it takes... I'm trying to do an OpenGL
animation, but I can't find a way to register an Idle-type function. I'm
shaky on this point: is there an event posted every run around the event
loop? Every clock tick? If I just override -sendEvent: (and can be assured
it gets called every run around the loop) then I have my answer. But what
risk am I taking overriding it?
Can I do something like

-(void)sendEvent:(NSEvent *)anEvent
{
//filter out any events I need in the ViewPort

[super sendEvent:anEvent];
[modelController updateModel];
}

?

Will this get called repeatedly by the Window Server?

bg
--
Void where prohibited.


  • Follow-Ups:
    • Re: [NEWBIE] Background tasks -- got it...
      • From: Brent Gulanowski <email@hidden>
  • Prev by Date: Another Cocoa Bug!! :<
  • Next by Date: Re: [NEWBIE] Background tasks -- got it...
  • Previous by thread: Re: Another Cocoa Bug!! :<
  • Next by thread: Re: [NEWBIE] Background tasks -- got it...
  • Index(es):
    • Date
    • Thread