Re: Calling you...
Re: Calling you...
- Subject: Re: Calling you...
- From: Thomas Deniau <email@hidden>
- Date: Sat, 26 Jan 2002 13:06:31 +0100
Le 26/01/02 12:52, Riccardo Santato disait :
>
- (void) buttonAction:(id)sender+
>
{
>
Second_Class *mw;
>
mw=[[Second_Class alloc] init];
>
[mw openWindow];
>
}
>
>
while in the "second_class":
>
>
-(void)openWindow
>
{
>
[second_window makeKeyAndOrderFront:self];
>
[NSApp runModalForWindow:second_window];
>
}
>
>
I would add these: the outlets are rightly set, the "runModalForWindow"
>
tells me that "Modal session requires modal window" and the
>
"second_window" is not displayed. Why ? I've checked Gunnar source code
>
but it does the very same things as me.. Where's my error ?
>
Please excuse my poor programming technique.
If you get an instance of your class using alloc] init] then its outlets
won't be set.
You must either use an outlet in first_class to the nib instance of
second_class, either put second_class and second_window in another nib and
use -[NSBundle loadNibNamed:owner:]
Or, if you don't want a modal window, you can simply make a connection from
the button to the window and select the action makeKeyAndOrderFront:
--
Thomas Deniau