• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Linking the "document edited" flag to the Undo menu item state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking the "document edited" flag to the Undo menu item state


  • Subject: Re: Linking the "document edited" flag to the Undo menu item state
  • From: Ashley Clark <email@hidden>
  • Date: Fri, 3 Apr 2009 11:22:10 -0500

On Apr 2, 2009, at 10:57 PM, Huibert Aalbers wrote:

Hi everyone,

I am writing an application that offers support for Undo/Redo. Everything works fine, except for a small detail that bothers me.

Since I set the document edited flag manually, using the [theWindow setDocumentEdited:YES] instruction each time the document is modified, I have no way to remove the flag when a user undoes all the changes.

The solution would be to set the document edited flag based on the status of the Undo menu item state. Is there a simple way to do this?

Register an observer on your undo manager's NSUndoManagerDidUndoChangeNotification and NSUndoManagerDidRedoChangeNotification and set your dirty flag there.


As far as I know returning the undo manager via your window delegate's windowWillReturnUndoManager: only keeps the window from creating its' own undo manager, it does not set up the mechanisms to update the window's dirty state.


Ashley _______________________________________________

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


  • Follow-Ups:
    • Re: Linking the "document edited" flag to the Undo menu item state
      • From: Graham Cox <email@hidden>
    • Re: Linking the "document edited" flag to the Undo menu item state
      • From: Huibert Aalbers <email@hidden>
References: 
 >Linking the "document edited" flag to the Undo menu item state (From: Huibert Aalbers <email@hidden>)

  • Prev by Date: IB Plugin help
  • Next by Date: Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?
  • Previous by thread: Re: Linking the "document edited" flag to the Undo menu item state
  • Next by thread: Re: Linking the "document edited" flag to the Undo menu item state
  • Index(es):
    • Date
    • Thread