I am trying to create a custom sheet for my application.
The sheet is contained in a separate nib named "CalendarSheet", and
has a class called CalendarSheetController set as its File Owner. (The
class is below).
I open the sheet like so:
[calendarSheet showSheet:mainWindow];
Where mainWindow is defined as:
IBOutlet NSWindow *mainWindow;
(and is set up correctly).
This loads the nib, but displays it as a separate window, and not a
sheet. It doesnt have a title bar, but it is not attached to the
application window, and is not modal. In searching on google, I have
seen this reported a couple of times, but found no resolution.
I apologize if this is a super simple issue, but I am relatively new
to Cocoa, and am trying to get my head around the model.
Anyone see what I might be doing wrong? or any tips on what to check?
-------CalendarSheet.h---------
#import <Cocoa/Cocoa.h>
@interface CalendarSheetController : NSWindowController
{
IBOutlet NSWindow *sheet;
}
- (void)showSheet: (NSWindow *)window;
@end
-------CalendarSheet.m---------
#import "CalendarSheetController.h"
@implementation CalendarSheetController
-(id)init
{
if(![super init])
{
return nil;
}
return self;
}
-(void)dealloc
{
[super dealloc];
}
- (void)showSheet: (NSWindow *)window
{
if (sheet == nil)
{
[NSBundle loadNibNamed: @"CalendarSheet" owner: self];
}
[NSApp beginSheet: sheet
modalForWindow: window
modalDelegate: self
didEndSelector:
@selector(didEndSheet:returnCode:contextInfo:)
contextInfo: nil];
}
@end
-----------
mike
_______________________________________________
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