Re: Window display problems
Re: Window display problems
- Subject: Re: Window display problems
- From: Stéphane Sudre <email@hidden>
- Date: Tue, 14 Jan 2003 16:44:09 +0100
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.