Creating additional windows in an NSDocument arch
Creating additional windows in an NSDocument arch
- Subject: Creating additional windows in an NSDocument arch
- From: Steve Palmer <email@hidden>
- Date: Mon, 15 Mar 2004 22:01:46 -0800
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.