changing name of untitled document
changing name of untitled document
- Subject: changing name of untitled document
- From: Kurt Sutter <email@hidden>
- Date: Sun, 2 Jan 2011 06:13:18 +0100
hi
Our application supports two types of NSDocuments. One contains data, the other drawings. Hence, we have defined two sibling classes of NSDocument: DataDocument and DrawingDocument.
When I create a new instance of DataDocument or DrawingDocument, its window is named "Untitled". However, I would like the new data document to be titled "Untitled Data", and the new drawing document to be titled "Untitled Drawing", so the user can easily distinguish the two, e.g. in the windows menu.
Obviously, I could overwrite windowTitleForDocumentDisplayName in my window controllers to change the name of the window from "Untitled ..." to "Untitled Drawing ..." or "Untitled Data..." as long as the document has not been associated with a file. However, if I then chose "Save...", the save panel still displays "Untitled". To fix that, I probably could modify the default name in the panel by some twiddling in prepareSavePanel, but I guess there will be other places (such as error messages) where the unfortunate "Untitled" still pops up.
Any advice how to set the name of an untitled document at one central place?
k
_______________________________________________
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