bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindowController doesn't load Gorm file.


From: Yen-Ju Chen
Subject: Re: NSWindowController doesn't load Gorm file.
Date: Sun, 16 Feb 2003 14:36:55 -0500


 That problem is that the nib is loaded,
 but the internal _window is not set.
 Therefore, [NSWindowController window] only load the nib,
 but not return the loaded window.
 I can use [NSWindowController setWindow: xxx] to make it work,
 but it is not what the Cocoa document say.
 In ideal case, I can use [NSWindowController initWithNibName: Owner:].
 And [NSWindowController window] should return the loaded window
 because it will load and set the window.
 Now, I have to manually use -loadWindow and -setWindow:.
 I think the problem is in the -loadWindow of NSWindowController,
 but in the source code, I can't find where the loaded window is.
 [NSBundle loadNibNamed:] only return BOOL, not the loaded window.

 Yen-Ju

From: Nicola Pero <nicola@brainstorm.co.uk>
To: Yen-Ju Chen <yjchenx@hotmail.com>
CC: bug-gnustep@gnu.org
Subject: Re: NSWindowController doesn't load Gorm file.
Date: Sun, 16 Feb 2003 02:05:26 +0000 (GMT)


> I try to load the Gorm file using NSWindowController
> -initWithWindowNibName:Owner:.
> I have an outlet connected to the window (actually, panel).
> At this step, the window is not loaded.
> Then I try [NSWindowController window].
> The window is loaded, but [NSWindowController window] return nil.
> I think it is a bug unless I did something wrong.
> I attach the test files.

Hmmm.

If I remember correctly, I think you want to use -initWithWindowNibName:,
which sets the 'owner' of the nib to be the window controller.

Then, in the nib file you need to create an outlet which sets the 'window'
of the 'owner' to be the window in the nib.

That way, when the window controller loads the nib, it is the file owner,
and its window is set to be the loaded window.

I'd suggest this route ... if I remember correctly, this route is the
simplest way of using a NSWindowController - so I'd suggest this route as
a start - using a different 'owner' seems confusing.


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail





reply via email to

[Prev in Thread] Current Thread [Next in Thread]