Re: System Preference Pane Problems
Re: System Preference Pane Problems
- Subject: Re: System Preference Pane Problems
- From: Dustin Voss <email@hidden>
- Date: Fri, 30 May 2003 17:50:09 -0700
On Friday, May 30, 2003, at 11:43 AM, John Farmer wrote:
This is what my Create New Profile button does:
[NSApp beginSheet: createANewProfileWIndow
modalForWindow:[NSApp mainWindow]
modalDelegate:self
didEndSelector:NULL
contextInfo:NULL];
[NSApp runModalForWindow:createANewProfileWindow];
[NSApp endSheet: createANewProfileWindow];
And this is what my Cancel and Apply do in the window to close it:
[NSApp endSheet:createANewProfileWindow];
[createANewProfileWindow orderOut:self];
[NSApp stopModal];
I create my preference panel's About sheet like so:
- (void) openPanel
{
[NSApp beginSheet:panel modalForWindow:[NSApp mainWindow]
modalDelegate:nil didEndSelector:nil contextInfo:nil];
}
I close it like so (connected to the "OK" button):
- (void)closePanel:(id)sender
{
[panel close];
[NSApp endSheet:panel];
}
This seems to work. Apple's documentation on how to make a sheet is
incorrect. You don't need to call "runModalForWindow:" or "stopModal".
-- Dustin
_______________________________________________
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.