I'm new to cocoa, I'm trying to display an alertbox. This is the code:

NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];
[alert setMessageText:@"Delete the record?"];
[alert setInformativeText:@"Deleted records cannot be restored."];
[alert setAlertStyle:NSWarningAlertStyle];

[alert beginSheetModalForWindow: (NSWindow *)window modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil];

- (void)alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
  contextInfo:(void *)contextInfo {
NSLog(@"Test)
}

I cannot find out how to refer to the window of my single window program in the method: beginSheetModalForWindow
Some help would be appreciated!

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to