Menu Items "Save" "Save As" and "Revert" won't enable for Document
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