On Dec 4, 2009, at 7:18 AM, Graham Cox wrote:

> I'm looking at the docs now, and for this use, it seems I would want 
> kCFRunLoopAfterWaiting to OPEN any undo groups, because that's just before 
> processing an event, but it's a little less clear when I should do the 
> automatic close. Presumably once the event is finished being handled the loop 
> continues, so would kCFRunLoopBeforeTimers effectively represent the end (as 
> well as the very start) of a given event cycle?

I think what you say sounds right.  A look through the CF sources might provide 
some enlightenment here too.  I would try kCFRunLoopBeforeTimers to see if that 
works for your use case.


> Otherwise how would I know when an event has been completely handled?

The only other thing that comes to mind would be to create some autoreleased 
object when you open the undo group which closes the undo group when released, 
since each cycle of the run loop should drain the autorelease pool.  This feels 
like a hack though, and it of course doesn't work if you need to support 
garbage collection.


Jason


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to