Re: Sheet not ending
Re: Sheet not ending
- Subject: Re: Sheet not ending
- From: Gerd Knops <email@hidden>
- Date: Wed, 4 Mar 2009 11:50:06 -0600
On Mar 4, 2009, at 11:45 AM, Mr. Gecko wrote:
Hello, I'm finding something weird. I am writing an application that
posts comments. I am able to open the sheet and I have a post and
cancel button, they work when you push them, but when I call
endSheet with NSApplication, it doesn't end until you quit the
application.
Here is my code below, tell me if I'm doing anything wrong.
- (IBAction)postComment:(id)sender {
[commentView setString:@""];
[countField setStringValue:@"500 Remaining"];
[[NSApplication sharedApplication] beginSheet:postCommentWindow
modalForWindow:commentWindow modalDelegate:nil didEndSelector:nil
contextInfo:nil];
}
- (IBAction)cancelPost:(id)sender {
[[NSApplication sharedApplication] endSheet:postCommentWindow
returnCode:NSCancelButton];
}
- (IBAction)post:(id)sender {
[[NSApplication sharedApplication] endSheet:postCommentWindow
returnCode:NSOKButton];
}
You'll need a "orderOut:" call on the sheet somewhere, see
http://developer.apple.com/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingCustomSheets.html
Gerd
_______________________________________________
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