Re: dismissing sheets.
Re: dismissing sheets.
- Subject: Re: dismissing sheets.
- From: j o a r <email@hidden>
- Date: Fri, 7 Feb 2003 16:43:52 +0100
I have to reply to my own email - this type of mistakes simply won't
do... ;)
On Friday, Feb 7, 2003, at 16:23 Europe/Stockholm, j o a r wrote:
- (void) sheetEnded: (NSWindow *)sheet returnCode: (int)returnCode
context: (void *)contextInfo
{
[NSApp endSheet: sheet];
[sheet orderOut: self];
}
Should be replaced, corrected, and expanded, into something like this:
- (IBAction *) myButtonAction:(id) sender
{
// The user hit one of the buttons in the sheet
[self getRidOfTheSheet];
}
- (void) someMethod
{
// You decide to take down the sheet because of something not
// triggered by user events
[self getRidOfTheSheet];
}
- (void) getRidOfTheSheet
{
[NSApp endSheet: mySheet];
[mySheet orderOut: nil];
}
- (void) sheetEnded: (NSWindow *)sheet returnCode: (int)returnCode
context: (void *)contextInfo
{
// Whatever needs to be done after the sheet is closed, perhaps release
// the contextInfo object for example.
}
j o a r
_______________________________________________
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.