Skip navigation.
 
mlUnderstaing NSNotificationQueue and IDLE
FROM : Francisco Tolmasky
DATE : Thu Apr 24 11:26:36 2008

It has often been asked on this mailing list how to get undo working 
with continuous controls, and the generally agreed upon answer seems 
to be to use NSNotificationQueue to coalesce notifications under 
NSPostWhenIdle.  In fact in a previous thread it was said that this 
method would work whether or not continuous controls were implemented 
using modal event loops (that is, instead of using mouseDown/dragged/
up).  My question is whether this is really true.  From playing around 
with this, it appears that the only reason the runloop isn't "idle" 
when holding a slider still is that the loop is eating up all the 
events, while if I mouse down and drag in other parts of the window 
"idle" notifications are indeed sent.  Does this mean that using the 
NSNotificationQueue method would break if Apple every chose to use 
mouseDown/dragged/and up instead of just setting up a modal event loop 
on mousedown?

Thanks,

Francisco

Related mailsAuthorDate
No related mails found.