RE: Window display problems
RE: Window display problems
- Subject: RE: Window display problems
- From: "Josh Ferguson" <email@hidden>
- Date: Tue, 14 Jan 2003 09:52:31 -0600
- Thread-topic: Window display problems
Actually, loading the nib wasn't the problem...This was already done in the controller. Apparently, though, the views weren't initialized until the window was displayed. I fixed this simply by calling [self window] in the progress's init method.
-----Original Message-----
From: Stiphane Sudre [
mailto:email@hidden]
Sent: Tuesday, January 14, 2003 9:44 AM
To: Josh Ferguson
Cc: Cocoa Development List
Subject: Re: Window display problems
On mardi, janvier 14, 2003, at 04:14 PM, Josh Ferguson wrote:
>
I know there must be a simple solution to this, but I haven't figured
>
it out yet. I have a .nib file that will be loaded as a sheet (it's a
>
progress dialog). I initialize the controller for this nib file when
>
my main controller finishes loading. The .nib file simply consists of
>
a window with an NSImageView, a progress indicator, and two text
>
fiels. My problem is that I want to set the image for the NSImageView
>
before the window is displayed, but it seems that the NSImageView
>
isn't initialized until the window is displayed for the first time.
>
This means that the window will be displayed and then the views will
>
be updated. Is there a way to make sure that the window (and all
>
views inside of it) are initialized when I initialize the controller,
>
so that I can set the properties on these views before I display the
>
window for the first time?
I'm not sure to fully understand the situation but it looks like you
have something like this:
@interface MyMainController
MySecondaryController * myController;
@end
@implementation MyMainController
- (id) didFinishLoading
{
myController=[MySecondaryController alloc];
}
@end
If this is the case, a solution is to do this when you display your
window:
@implementation MySecondaryController
...
- (void) displayMyWindow
{
if (!MyImageOutlet)
{
if (![NSBundle loadNibNamed:@"MySecondaryNib" owner:self])
{
NSLog(@"Failed to load IAMultipleIP.nib");
NSBeep();
return;
}
[MyImageOutlet setImage: What you want here];
}
// Display sheet
// TO BE CONTINUED
}
_______________________________________________
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.