Re: custom window controllers
Re: custom window controllers
- Subject: Re: custom window controllers
- From: Eric <email@hidden>
- Date: Thu, 19 Sep 2002 10:01:04 -0400
on 9/19/02 2:40 AM, Donald S. Hall at email@hidden wrote:
>
Does anyone have a sample code snippet for installing a custom window
>
controller for a document? I want to modify the document window title, and
>
this seems to be the way to do it. I have read over the documentation and
>
see the methods I need to work with. I must override -makeWindowControllers
>
in my NSDocument subclass to create my custom window controller. Do I need
>
to send [self makeWindowControllers] somewhere? (Where?) Also, it says I
>
must send the -addWindowController message to add my controller to the
>
document's list of controllers. Again, where should I do this? In -init? In
>
-makeWindowControllers?
>
>
Thanks for any help,
>
>
Don
>
--
>
Donald S. Hall, Ph.D.
>
Apps & More Software Design, Inc.
>
http://www.theboss.net/appsmore
>
email@hidden
>
Here's a snippet:
- (void) makeWindowControllers
{
MyWindowController *windowController = [[MyWindowController alloc]
init];
[self addWindowController: windowController];
[windowController release];
}
If you are using the multiple document architecture, you don't need to call
this method yourself. Your application's NSDocumentController shared
instance will automatically call it for you. As for modifying the document
window title, you can override -windowTitleForDocumentDisplayName: in your
custom window controller to return something other than the document's
default display name.
Eric Wang
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.