Skip navigation.
 
mlRe: Disabling Revert
FROM : Jonathan Grynspan
DATE : Tue Jul 04 21:01:29 2006

Add this code to your NSDocument subclass:

- (BOOL)validateUserInterfaceItem: (id <NSValidatedUserInterfaceItem>)
anItem {
   SEL action;
   
   action = [anItem action];
   if (action == @selector(revertDocumentToSaved:))
       return [self isDocumentEdited];
   else
       return [super validateUserInterfaceItem: anItem];
}

-Jonathan Grynspan

On 4-Jul-06, at 12:54 PM, David Dunham wrote:

> Cocoa enables Revert all the time. One of my users is complaining 
> that choosing it does nothing. It seems a little silly to handle 
> the action just to restore the insertion point to its saved 
> position, so is it possible do disable the command unless it will 
> actually read from the NSDocument's file?
>
> David Dunham    A Sharp, LLC
> Voice/Fax: 206 783 7404    http://a-sharp.com
> Efficiency is intelligent laziness.
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev

Related mailsAuthorDate
mlDisabling Revert David Dunham Jul 4, 18:54
mlRe: Disabling Revert Jonathan Grynspan Jul 4, 21:01
mlRe: Disabling Revert Christiaan Hofman Jul 6, 13:56