• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Modal dialog over modal dialog in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modal dialog over modal dialog in Cocoa


  • Subject: Modal dialog over modal dialog in Cocoa
  • From: John Yeh <email@hidden>
  • Date: Tue, 21 Apr 2009 15:37:07 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Modal dialog over modal dialog in Cocoa

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 (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

  • Follow-Ups:
    • Re: Modal dialog over modal dialog in Cocoa
      • From: Ken Thomases <email@hidden>
    • Re: Modal dialog over modal dialog in Cocoa
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: newbie questions on NSString* as a class attribute
  • Next by Date: iphone SDK session duration
  • Previous by thread: Re: newbie questions on NSString* as a class attribute
  • Next by thread: Re: Modal dialog over modal dialog in Cocoa
  • Index(es):
    • Date
    • Thread