Customize NSAlert?
Customize NSAlert?
- Subject: Customize NSAlert?
- From: Dave Jewell <email@hidden>
- Date: Wed, 7 Feb 2007 00:32:12 +0000
Hi Jerry. The simplest way to add a "Don't show me this again"
checkbox to NSAlert is (somewhat inevitably) to use an undocumented
API. There are two messages which are relevant. Firstly:
- (void) _setDontWarnMessage: (NSString *) message;
You use this message to set the text for your checkbox while setting
up your NSAlert but (obviously) before calling runModal.
Secondly, after calling runModal, you can use the message below to
test whether the user checked the box.
- (BOOL) _dontWarnAgain;
At this point someone will doubtless read me the riot act for
mentioning undocumented calls. :-)
But the simplicity of use of these two methods contrasts strongly
with the major PITA that you have to go through without them. This
functionality is needed so frequently that this stuff really SHOULD
be part of the official API.
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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