Re: Removing the Filename flag in Doc. based Application
Re: Removing the Filename flag in Doc. based Application
- Subject: Re: Removing the Filename flag in Doc. based Application
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 23 May 2008 17:13:48 -0400
On Fri, May 23, 2008 at 12:33 PM, vince <email@hidden> 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
_______________________________________________
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