• 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
Menu Items "Save" "Save As" and "Revert" won't enable for Document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Menu Items "Save" "Save As" and "Revert" won't enable for Document


  • Subject: Menu Items "Save" "Save As" and "Revert" won't enable for Document
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 21 Aug 2006 10:11:22 -0700
  • Thread-topic: Menu Items "Save" "Save As" and "Revert" won't enable for Document

My app had a non-document window, controlled by an NSWindowController, which
I've just converted to being a document window by cleverly opening the
window nib's classes.nib file and changing the superclass of the old window
controller from NSWindowController to NSDocument, and then implementing the
document load and save methods in its implementation, etc.

I also added a File menu and wired its items to target the FirstResponder in
the standard way:

    New --> newDocument:
    Open --> openDocument:
    Close --> performClose:
    Save --> saveDocument:
    Save As --> saveDocumentAs:
    Revert --> revertDocumenttoSaved:

The menu items New, Open and Close work as expcted, and I can use them to
create, save, and re-open documents.  If the document has been edited, the
red Close button gets the "dirty "dot in it, and I get an alert sheet with
"Don't Save" and "Save" buttons when I click Close.

But the Save, Save As and Revert menu items are always disabled.  Since this
thing is 95% working, I must have neglected one little detail, but I can't
find it.  Any guesses would be appreciated.

Jerry Krinock

Since this document is only a few control settings, I am not supporting Undo
and Redo, so I -updateChangeCount:NSChangeDone whenever a change is made.
This all seems to work.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Menu Items "Save" "Save As" and "Revert" won't enable for Document
      • From: Michael Nickerson <email@hidden>
  • Prev by Date: Re: 2nd try, tabbing doesn't work properly in NSTableView?
  • Next by Date: Re: Bindings and NSTableColumns
  • Previous by thread: any way to get or catch the last error generated by a running application through code
  • Next by thread: Re: Menu Items "Save" "Save As" and "Revert" won't enable for Document
  • Index(es):
    • Date
    • Thread