discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheduling functions to be run all the time in runloop


From: Richard Frith-Macdonald
Subject: Re: Scheduling functions to be run all the time in runloop
Date: Tue, 10 Jul 2012 07:21:50 +0100

On 10 Jul 2012, at 06:20, Dr. H. Nikolaus Schaller wrote:

> 
> Am 09.07.2012 um 23:13 schrieb Ivan Vučica:
> 

>> They seem to be triggered whenever a "source is processed" and "before the 
>> run loop goes to sleep" - which sounds exactly like what I need. However, 
>> based on their name and the location inside Core Foundation framework, I 
>> presume that they are not implemented in this form in GNUstep.
>> 
>> So, is there an alternative way to insert my functions whenever a source is 
>> processed and before the run loop goes to sleep that works with GNUstep?
> 
> AFAIK, this is not available in GNUstep.

Sure it is ...

The Apple compatible method to do something in the next loop iteration is: 
-performSelector: target: argument: order: modes: 
The Apple compatible way to do something when the loop becomes idle is to use 
NSNotificationQueue

And if you want higher performance/flexibility and don't need Apple 
compatibility, you might use the GNUstep extension -addEvent: type: watcher: 
forMode: as this allows your watcher to provide callbacks controlling how/when 
the runloop fires it.

All that being said, I would have thought that animation was something that you 
would want to do at regular intervals ... so using a timer would make sense.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]