• 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
changing name of untitled document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: changing name of untitled document
      • From: Quincey Morris <email@hidden>
  • Prev by Date: NSTableView with ArrayController bindings not updating?
  • Next by Date: iPhone UISearchDisplayController how to handle memory warning
  • Previous by thread: Re: NSTableView with ArrayController bindings not updating?
  • Next by thread: Re: changing name of untitled document
  • Index(es):
    • Date
    • Thread