Trouble with sheets...
Trouble with sheets...
- Subject: Trouble with sheets...
- From: Bruce Beerbower <email@hidden>
- Date: Sat, 17 Jun 2006 20:06:36 -0400
I'm having trouble trying to display a panel as a sheet. I'v read
through the Cocoa documentation and a book I have (Cocoa In A
Nutshell) on this subject and this is (more or less) the code I have:
#import <Cocoa/Cocoa.h>
@interface SheetController : NSObject
{
IBOutlet NSPanel *thePanel;
IBOutlet NSWindow *mainWindow;
}
- (IBAction)openSheet:(id)sender; // Button action from mainWindow
- (IBAction)closeSheet:(id)sender; // Button action from thePanel
@end
@implementation SheetController
- (IBAction)openSheet:(id)sender
{
[NSApp beginSheet:thePanel
modalForWindow:mainWindow
modalDelegate:self // I think this might be the problem. What
should it be?
didEndSelector:nil
contextInfo:NULL];
}
- (IBAction)closeSheet(id)sender
{
[NSApp endSheet:addPanel];
}
@end
This compiles just fine but it doesn't seem to work; when I press the
button which triggers openSheet the sheet opens properly, but when I
press the button which triggers closeSheet it doesn't close. Dose
anybody see what I'm doing wrong?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden