Hi,
I have a NSDocument application.
Recently I added an Modal Dialog at the start up and a side effect appeared.
The Modal Dialog appear and when entering what needed there it is closed, and the main application take over the control. The side effect is that I am not able to close the application after the Modal Dialog has been opened and closed. CMD-Q does not work, In the menu the Quit command is grayed out.
If I do not activate the Modal Dialog there are no problems with the Quit.
Dialog controller looks like this:
Any tip out there ?
Thanks in advance.
/petron
I have a NSDocument application.
Recently I added an Modal Dialog at the start up and a side effect appeared.
The Modal Dialog appear and when entering what needed there it is closed, and the main application take over the control. The side effect is that I am not able to close the application after the Modal Dialog has been opened and closed. CMD-Q does not work, In the menu the Quit command is grayed out.
If I do not activate the Modal Dialog there are no problems with the Quit.
Dialog controller looks like this:
Code:
#import "DialogController.h"
@implementation DialogController
- (id)init
{
[super init];
return self;
}
- (NSString *)showStartUpDialog:(NSWindow *)window
{
if (!myStartupDialog) {
[NSBundle loadNibNamed:@"MyStartUpDialog" owner:self];
}
[NSApp beginSheet: myStartupDialog
modalForWindow: window
modalDelegate: nil
didEndSelector: nil
contextInfo: nil];
[NSApp runModalForWindow: myStartupDialog];
// Dialog is up here.
[NSApp endSheet: myStartupDialog];
[myStartupDialog orderOut: self];
return logFileName;
}
- (IBAction)endDialogSheetAndCreate:(id)sender
{
logFileName = [fileNameField stringValue];
if ([logFileName length] <= 0) {
logFileName = nil;
}
[NSApp stopModal];
}
- (IBAction)endDialogSheetAndCancel:(id)sender
{
logFileName = nil;
[NSApp stopModal];
}
@end
Any tip out there ?
Thanks in advance.
/petron