Sheet comes up inactive
Sheet comes up inactive
- Subject: Sheet comes up inactive
- From: Dave Riggle <email@hidden>
- Date: Wed, 24 Sep 2003 14:05:42 -0700
I have an NSWindowController that controls an NSPanel. When I put up a
sheet on top of it, the sheet and window both go inactive. When I
dismiss the sheet, the owning window stays inactive. I've tried making
the sheet window out of an NSWindow as well as an NSPanel. Both
exhibit the same behavior. How do I get the sheet to stay active? My
code is below.
Dave
@implementation WindowController
- (id)init
{
if (self = [super init]) {
[NSBundle loadNibNamed:@"EditWindow" owner:self];
}
return self;
}
- (void)showWindow
{
// show window
[[self window] makeKeyAndOrderFront:nil];
}
- (IBAction)doneButton:(id)sender
{
// close window
[[self window] orderOut:sender];
}
- (IBAction)bringUpSheetButton:(id)sender
{
// show sheet
[NSApp beginSheet:m_Sheet modalForWindow:[self window]
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo
{
}
- (IBAction)sheetDoneButton:(id)sender
{
// close sheet
[m_Sheet orderOut:sender];
[NSApp endSheet:m_Sheet returnCode:0];
}
@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.