Hello,
Apologies for the long email. Don't know enough about Mac development to ask the right questions. So want to give as much info as possible to describe my issue.
I have one main dialog which has three buttons that open three Panel windows. I have Controller classes (subclasses of NSWinController) for each of these panels that have closeButtonClicked method which simply calls [self close];
One of the three dialogs opens and closes fine. The other two dialogs just ignore the [self close] command. The panel stays open after clicking the close button. I have to use the red close button on the window bar to get rid of the window.
I see absolutely no differences in the controller code for the three panels and I followed the same method in creating the panels step by step as much as I can remember. Why do they behave differently?
Here is the main window controller code which has actions associated with three buttons on the main form.
Each of the panel controller headers have code very similar to this
Each panel controller has init method that loads the nib, and awakeFromNib has some logic to display right content.
closeButtonClicked has following code.
Why don't the windows close when I click on close button?
Thanks in advance for your help.
Apologies for the long email. Don't know enough about Mac development to ask the right questions. So want to give as much info as possible to describe my issue.
I have one main dialog which has three buttons that open three Panel windows. I have Controller classes (subclasses of NSWinController) for each of these panels that have closeButtonClicked method which simply calls [self close];
One of the three dialogs opens and closes fine. The other two dialogs just ignore the [self close] command. The panel stays open after clicking the close button. I have to use the red close button on the window bar to get rid of the window.
I see absolutely no differences in the controller code for the three panels and I followed the same method in creating the panels step by step as much as I can remember. Why do they behave differently?
Here is the main window controller code which has actions associated with three buttons on the main form.
Code:
- (IBAction)sendReport:(id)sender
{
[self updateUserDefaults];
NSString *steps = [tFieldStepByStep stringValue];
NSLog(@"Step By Step is %@", steps);
if (!progressDialog) {
progressDialog = [[ProgressDialogController alloc] init];
}
NSLog(@"Show progress pane ");
[progressDialog showWindow:self];
//Build the XML
[self buildDmpInfoXML];
}
- (IBAction)viewReportDetails:(id)sender
{
if (!cerDetailsController) {
cerDetailsController = [[CERDetailsController alloc] init];
}
NSLog(@"Show Details pane %@", cerDetailsController);
[cerDetailsController showWindow:self];
}
- (IBAction)viewExampleDescription:(id)sender
{
if (!exampleDescController) {
exampleDescController = [[ExampleDescriptionController alloc] init];
}
NSLog(@"Show Example pane %@", exampleDescController);
[exampleDescController showWindow:self];
}
Each of the panel controller headers have code very similar to this
Code:
#import <Cocoa/Cocoa.h>
#import <WebKit/WebView.h>
@interface ExampleDescriptionController : NSWindowController {
//IBOutlet NSTextField *tFieldExampleDescription;
IBOutlet WebView *webview;
}
-(IBAction)closeButtonClicked:(id)sender;
@end
Each panel controller has init method that loads the nib, and awakeFromNib has some logic to display right content.
Code:
-(id)init
{
if (![super initWithWindowNibName:@"ExampleDescription"])
return nil;
return self;
}
closeButtonClicked has following code.
Code:
-(IBAction)closeButtonClicked:(id)sender
{
[self close];
}
Why don't the windows close when I click on close button?
Thanks in advance for your help.