Re: [NSApp runModalForWindow:aWindow];
Re: [NSApp runModalForWindow:aWindow];
- Subject: Re: [NSApp runModalForWindow:aWindow];
- From: Mark Piccirelli <email@hidden>
- Date: Wed, 24 Oct 2001 15:49:58 -0700
It's not a good idea to invoke [NSApp runModalForWindow:] from within a
document's -makeWindowControllers method. An override of
-makeWindowControllers really shouldn't do much more than creating and
registering a document's windows controllers.
I can't suggest a better place for the -runModalForWindow: without
knowing more about the purpose of the panel in question...
-- Mark
On Wednesday, October 24, 2001, at 12:46 PM, Tae-Won Ha wrote:
Hi...
I've got a question regarding the runModalForWindow of NSApplication
class.
I have a Nib-file with a NSPanel which is controlled by a
NSWindowController.
Here my code:
NSDocument-subclass:
makeWindowControllers-method
{
...
windowController = [init stuff];
[self addWindowController:windowController]
result = [NSApp runModalForWindow:[windowController window]];
[windowController release];
...
}
NSWindowController-subclass:
okAction-IBAction
{
...
if(something is right)
{
[NSApp stopModal];
anotherWindowController = [init stuff];
[[self document] addWindowController:anotherWindowController];
[[anotherWindowController window] makeKeyAndOrderFront:self];
[self close];
}
}
The window of anotherWindowController shows up, but all of its window
control elements, e.g. close button, toolbar toggle button and so on,
are disabled. The toolbar items does not respond, although they are not
disabled. It does not respond to Close menu item, too.
How can I fix that???
Tae-Won Ha
http://www.taewon.de/
email@hidden
=)
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev