Re: Binding InfoPanel to currentDocument
Re: Binding InfoPanel to currentDocument
- Subject: Re: Binding InfoPanel to currentDocument
- From: Seth Willits <email@hidden>
- Date: Thu, 25 Oct 2012 17:43:36 -0700
On Oct 25, 2012, at 3:24 PM, Kyle Sluder wrote:
> On Thu, Oct 25, 2012, at 09:42 AM, Seth Willits wrote:
>>
>> But, if you just use the -object in the notification to
>> windowDidBecomeMain: you're fine. So if you keep a reference to that
>> window/document yourself and return it from your own currentDocument
>> that'd work. You also need to watch windowWillResignMain:
>> windowWillClose: and optionally(?) applicationDidBecomeActive: (And
>> actually, this is how Omni has been doing it for yeeeears.)
>
> NSWindow has a -document accessor, so you don't need to override
> -currentDocument.
>
> But yes, the gist of how OmniInspector works is that we listen for
> window did become/resign main notifications and prompt our inspectors to
> update themselves by traversing the responder chain of the main window.
I was not suggesting to override -[NSDocumentController currentDocument]. He has -[AppDelegate currentDocument].
--
Seth Willits
_______________________________________________
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