Re: Best way to hook into the run loop?
Re: Best way to hook into the run loop?
- Subject: Re: Best way to hook into the run loop?
- From: Graham Cox <email@hidden>
- Date: Sat, 5 Dec 2009 00:18:38 +1100
That looks perfect, thanks for the pointer.
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?
Otherwise how would I know when an event has been completely handled?
--Graham
On 04/12/2009, at 4:13 PM, Jason Foreman wrote:
>
> On Dec 3, 2009, at 10:17 PM, Graham Cox wrote:
>
>> One thing I'd like to do is to match NSUndoManager's ability to automatically open and close groups as the run loop cycles. What's the best way to do this?
>
> Possibly by using a CFRunLoopObserver. You can look into CFRunLoopObserverCreate and the related documentation. This will allow you to observe various stages of the run loop cycle.
>
>
>> I notice that NSUndoManager has a 'run loop modes' property but it's unclear where and how that is used.
>
> The modes are basically filters for which input sources get processed by a run loop cycle. There is a run loop mode used by modal panels and another for mouse tracking. An undo manager could use this mode to avoid (or explicitly allow) registering undos during a mouse drag, for example.
>
>
> Jason
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden