Skip navigation.
 
mlRe: Removing the Filename flag in Doc. based Application
FROM : Kyle Sluder
DATE : Fri May 23 23:13:48 2008

On Fri, May 23, 2008 at 12:33 PM, vince <<email_removed>> wrote:
> How do I set my document based application to omit the filename reference at
> the top of each opened document window?


It sounds like you need a little more education about how this works.
NSDocument has a window outlet, but the document itself doesn't manage
the window(s).  Instead, it creates one or more NSWindowController
objects.  Now, in the simple case, you override -[NSDocument
windowNibName] and NSDocument takes care of creating an
NSWindowController for you.  NSWindowController has some special logic
for dealing with document-based applications, including the method
-synchronizeWindowTitleWithDocumentName, which as its name implies is
responsible for deciding whether to replace the window title with the
result of -[NSWindowController windowTitleForDocumentDisplayName:].
By default, -[NSWindowController
synchronizeWindowTitleWithDocumentName] returns YES.  In your case,
you will want to subclass NSWindowController and override this method
to return NO.  That means that you can no longer take advantage of
NSDocument's default controller creation, of course; you will need to
instead override -[NSDocument makeWindowControllers] to instantiate
your custom window controller instead.

HTH,
--Kyle Sluder

Related mailsAuthorDate
mlRemoving the Filename flag in Doc. based Application vince May 23, 18:33
mlRe: Removing the Filename flag in Doc. based Application Kyle Sluder May 23, 23:13
mlRe: Removing the Filename flag in Doc. based Application Roland King May 24, 05:06
mlRe: Removing the Filename flag in Doc. based Application Kyle Sluder May 24, 06:52
mlRe: Removing the Filename flag in Doc. based Application Caleb Strockbine May 24, 10:02
mlRe: Removing the Filename flag in Doc. based Application Mark Piccirelli May 27, 23:33