problems with NSBeginAlertSheet
problems with NSBeginAlertSheet
- Subject: problems with NSBeginAlertSheet
- From: email@hidden
- Date: Thu, 17 May 2001 17:44:50 -0500
hello everyone. i am having problems with NSBeginAlertSheet. here's the
header for it..
APPKIT_EXTERN void NSBeginAlertSheet(NSString *title, NSString
*defaultButton, NSString *alternateButton, NSString *otherButton,
NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL
didDismissSelector, void *contextInfo, NSString *msg, ...);
now, i want to have a standard dialog here, when the user presses 'ok' i
want the sheet to call a method, and when the user presses 'cancel' i
want the sheet to go away without doing anything. seems simple enough.
well, i can get the sheet to display, and i can even get the sheet to
call the method i want. but.. instead of the method getting called only
when a certain button is pushed on the sheet, it is ALWAYS called after
the sheet has gone away. rather annoying. here is an example of the
usage i've been using (called from my Controller object):
NSBeginAlertSheet(@"Alert", @"OK", @"Cancel", NULL, [self window],
self, @selector(start), NULL, NULL, @"Press ok or cancel");
now, i have tried using all three possible buttons ( in the definition
above: *defaultButton, *alternateButton, and *otherButton) with no
success. i have also tried putting the selector in both the
*didEndSelector position and the *didDismissSelector position, both with
no luck, the method is called no matter what button is pushed. i have
tried putting a selector in both places (in case it didn't like have one
being NULL), still no luck.
i can not for the life of me figure out why the sheet is calling the
method regardless of which button is pushed.
is anyone else having this problem?
any help would be greatly appriciated.
Jason Moore
email@hidden