In Carban, I can create a modal dialog over a modal dialog without any problem. 
But in Cocoa, the second modal dialog is always displayed behind the first one, 
and the event loop is still on the first dialog. In other words, the second 
modal dialog is unclickable. Can you give me some information what I am doing 
incorrectly? Here are the code snippets I use in the project:

//---- code snippets start here ---------
//First modal dialog:
if (!settingsController) {
    NSApplicationLoad();
    settingsController = [[SettingsController alloc] init];
}

[NSApp runModalForWindow: [settingsController window]];
// Dialog is up here.
[NSApp endSheet: [settingsController window]];
[[settingsController window]orderOut: [settingsController window]];

//The second modal dialog is triggered by a button push in the first modal
//dialog:
if (!newCertController) {
    NSApplicationLoad();
    newCertController = [[NewCertController alloc] init];
}
[[newCertController window] makeKeyAndOrderFront:[newCertController
window]];
[NSApp runModalForWindow: [newCertController window]];
// Dialog is up here.
[NSApp endSheet: [newCertController window]];
[[newCertController window]orderOut: [newCertController window]];

The init function for each dialog looks like this:
@implementation SettingsController
- (id)init
{
    [super init];
    self = [super initWithWindowNibName:@"FLAirMainSettingsPanel"];
    return self;
}

Thanks.
-John
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to