Re: Creating additional windows in an NSDocument arch
Re: Creating additional windows in an NSDocument arch
- Subject: Re: Creating additional windows in an NSDocument arch
- From: Amul Goswamy <email@hidden>
- Date: Tue, 16 Mar 2004 09:01:49 -0800
You need to change the Custom Class of the File's Owner to
NSWindowController and connect it to the window.
Amul Goswamy
Interface Builder
Apple
On Mar 15, 2004, at 10:01 PM, Steve Palmer wrote:
So I now have an NSDocument based main window. I want to create
additional windows from a different NIB file and there may be 1..N
instances of the second window which can appear at any one time, and
these need to appear under the Window menu so the user can switch
between them. So I created a Window in a new NIB and gave it attributes
as required to ensure that it would qualify for showing up in the
Window menu.
From what I can see, I need to use a NSWindowController subclass,
create it with alloc and showWindow, and initWithWindowNibName in the
init function. Unfortunately the window doesn't show up. No error in
the console log and the init function is being called without any
problems.
What could I be missing? I assumed that a very basic skeleton
implementation as below would at least make the window visible.
...
ReplyWindow * commentWindow = [[ReplyWindow alloc] init];
[commentWindow showWindow:self];
...
@interface ReplyWindow : NSWindowController {
IBOutlet NSTextView * textView;
}
@end
@implementation ReplyWindow
-(id)init
{
self = [super initWithWindowNibName:@"Comment"];
return self;
}
@end
_______________________________________________
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.
_______________________________________________
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.