Re: closing modal window leaves next window inactive?
Re: closing modal window leaves next window inactive?
- Subject: Re: closing modal window leaves next window inactive?
- From: Matt Neuburg <email@hidden>
- Date: Mon, 02 Jul 2007 19:10:19 -0700
- Thread-topic: closing modal window leaves next window inactive?
On Mon, 2 Jul 2007 15:49:19 -0700, Steve Christensen <email@hidden> said:
>I have a controller that loads a window from a nib. It initializes
>the window and controls in its -awakeFromNib, then calls [NSApp
>runModalForWindow:_window] to run the window modally. When the OK
>button is hit, it calls [NSApp abortModal] to terminate the modal
>session. The modal window goes away, but the previously (and now
>current) frontmost window is inactive. Is that window supposed to
>become active automagically, or did I miss something in the setup/
>tear down?
Why can't I reproduce this? I tried this very simple code, and it worked
fine:
@implementation MyWindowController
- (NSString *)windowNibName {
return @"Second";
}
- (IBAction)myAction:(id)sender
{
[NSApp runModalForWindow: [self window]];
}
- (void)allDone:(id)sender {
[NSApp abortModal];
[[self window] orderOut:self];
}
That's the only code in my project and it does just what you want done: it
loads the othe nib, summons the window, and makes it modal; then it
dismisses the modal window and everything is back to normal, with the
remaining main window perfectly usable. So there must be other stuff going
on that you're not telling us. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden