Re: When in Versions browser
Re: When in Versions browser
- Subject: Re: When in Versions browser
- From: Martin Hewitson <email@hidden>
- Date: Sun, 22 Jan 2012 16:18:46 +0100
On 21, Jan, 2012, at 02:43 PM, Mike Abdullah wrote:
>
> On 21 Jan 2012, at 09:33, Martin Hewitson wrote:
>
>> Dear list,
>>
>> I'm trying to get Versions and autosave working on my document app. Most things are working. I'm using the window delegate methods
>>
>> - (void)windowWillEnterVersionBrowser:(NSNotification *)notification;
>> - (void)windowDidExitVersionBrowser:(NSNotification *)notification;
>>
>> to enable and disable some UI elements. I'm also setting a private ivar boolean _inVersionsBrowser to YES in
>>
>> - (void)windowDidEnterVersionBrowser:(NSNotification *)notification
>>
>> and to NO in
>>
>> - (void)windowDidExitVersionBrowser:(NSNotification *)notification
>>
>> Then in methods like -validateToolbarItem: I'm checking for this flag and returning NO if it's set to YES. This works for the current document window (all its toolbar items are disabled in the Versions browser) but not for the previous versions document windows. So, I need a more dynamic way to check if I'm in the Versions browser so that I can disable such things. Is there API to do that? I couldn't find it (obviously). Or is there a better way to do what I'm trying to do?
>
> -[NSDocument isInViewingMode]
Thanks! Missed that one.
Martin
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
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