initWithWindowNibName not loading window?
initWithWindowNibName not loading window?
- Subject: initWithWindowNibName not loading window?
- From: Matt Peterson <email@hidden>
- Date: Sun, 7 Apr 2002 16:59:44 -0500
Hi Folks,
First a little background. I'm making a charting program, and I want
the user to be able to double click on the plot legend (a subclassed
NSView) and have it open a window where line styles, line colors, plot
symbols, etc., can be set.
Right now, when a user double-clicks on the plot legend subview, the
subview attempts to make a new NSWindowController (i've subclassed it to
PlotStylesController) and load the window from a nib. The window never
opens. When I stepped through the program in the debugger, the
NScontroller's _windowNibName: contains the path to my nib, but the
pointer to _window is NULL. Interestingly, in my code snippet below,
isWindowLoaded returns TRUE.
Any idea what's going on? Here is my code snippet below and some
info on my nib file
Thanks in advance,
-Matt
******************
<snippet from my plot legend NSView subclass>
if(SettingsWindow == NULL) // if one doesn't exist, make a new one
{
SettingsWindowController = [[PlotStylesController alloc]
init]; // see code below for init
[SettingsWindowController window];
HaveWindow = [SettingsWindowController isWindowLoaded]; //
this always returns TRUE, BTW
SettingsWindow = [SettingsWindowController window];
if(SettingsWindow == NULL)
printf(" SettingsWindow never loaded\n"); //
when i run my code, this is always NULL
}
[SettingsWindowController showWindow:self];
**********************************
< init function for my NSWindowController subclass PlotStylesController >
@implementation PlotStylesController
- (id)init
{
self = [super initWithWindowNibName:@"Plotstyles"];
if (self)
{ // do something here
}
return self;
}
@end
****************************
< Nib info for Plotstyles.nib >
3 instances:
(1) File's owner of type PlotStylesController,
window outlet connected to PlotStylesWindow
(2) First Responder
(3) PlotStylesWindow (subclass of NSWindow)
delegate set to PlotStylesController
'visible at launch time' checked
_______________________________________________
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.