• 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
manage documentEdited
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

manage documentEdited


  • Subject: manage documentEdited
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Mon, 8 Apr 2002 21:32:37 +0200

I have a document based application, which uses the build-in undo.

The problem is that there are (beside real changes: which change the data) also non-real changes, which change the look of the document and which are part of the undo mechanism, but which do not change the data.

I would like to have the window not show the document-edited flag if only non-real changes have taken place.

This is what I tried:

-changeSomething
{
BOOL alreadyEdited = [ myWindow isDocumentEdited ];

[[[self undoManager] prepareWithInvocationTarget:self] undoSomething ];

// make real or non-real changes

if ( changesAreNonReal && ! alreadyEdited ) // reset isDocumentEdited
{
[ myWindow setDocumentEdited: NO ];
}
}

But, the isDocumentEdited of my window is not set (by the NSDocumentController ?) inside my changeSomething method, but at the end of the event loop.
So the "setDocumentEdited: NO" is quite pointless here; it should be done after the NSDocumentController has changed the flag.
Could some UndoManager notification be of help? If yes, which one?

Another problem:
There is a isDocumentEdited of the document and another of the window. If I reset the window flag somewhere (without changing the other one) the window will stay unEdited forever.

So I should really use the isDocumentEdited of the document, but this cannot be set. Or can it be set? If yes, how?

Any ideas?

Gerriet.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: manage documentEdited
      • From: Bill Cheeseman <email@hidden>
    • Re: Cocoa:manage documentEdited
      • From: Timothy Larkin <email@hidden>
  • Prev by Date: Re: Question about System Services
  • Next by Date: Re: Cocoa:manage documentEdited
  • Previous by thread: Updating Dock mini windows
  • Next by thread: Re: Cocoa:manage documentEdited
  • Index(es):
    • Date
    • Thread