Re: Can NSBeginAlertSheet call be dismissed?
Re: Can NSBeginAlertSheet call be dismissed?
- Subject: Re: Can NSBeginAlertSheet call be dismissed?
- From: Adam Leonard <email@hidden>
- Date: Tue, 25 Oct 2005 20:10:41 -0700
The easiest way would probably be to use NSAlert. You can create the
message with:
NSAlert *alert = [[NSAlert alertWithMessageText:@"Hi"
defaultButton:@"OK"
alternateButton:@"button 2"
otherButton:@"button 3"
informativeTextWithFormat:@"Hello"]retain];
Then, just show the sheet using beginSheetModalForWindow: and when
you want to dismiss the sheet you can get the reference to the window
with [alert window], and then just dismiss it like any other sheet.
Remember to then release the alert.
Hope that helps
On Oct 25, 2005, at 9:24 AM, Steve Sheets wrote:
Can the modal sheet Alert that appears with a NSBeginAlertSheet
call be dismissed by the program without user interaction? Normally
the alert window that this call creates is dismissed when the user
click on one of the buttons (ex. Ok, Cancel). The appropriate
selector action is called, and the window is dismissed. However,
there are times when the status of the program has changed, due to
network action or a timer, and I want to be able to dismiss the
window without the user having to click on the OK or Cancel
button. Is there a call to do this? Or should I create a modal
alert sheet for the window in a different way?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden