Re: How to avoid a Windows interface on OS X?
Re: How to avoid a Windows interface on OS X?
- Subject: Re: How to avoid a Windows interface on OS X?
- From: Chris Hanson <email@hidden>
- Date: Thu, 17 Oct 2002 15:09:57 -0500
At 7:05 PM -0500 10/15/02, Charles Srstka wrote:
You know, I actually agree with Ondra on this one - it's not a good
idea to make Cancel the default. If it's really a dangerous
operation, a better solution would be just to have no default button
at all.
Completely stated, this is a much more reasonable position. (At the
start of the argument, people were just saying "No, Cancel shouldn't
be the default!" As if it was acceptable to have a destructive,
non-undoable default choice in an alert.)
I do disagree with this position; I vastly prefer the Macintosh
style. On the other hand, I can at least live with software that
follows the above style.
With that said, here's how to do it. It's quite simple, actually.
Instead of NSRunAlertPanel() or NSBeginAlertSheet(), you use another
API called NSGetAlertPanel() to get the NSPanel for the alert box
*without* displaying it. You can then change the default button to
NULL to make your panel have no default, or you could probably muck
around with -[[NSWindow contentView] subviews] to find the other
buttons and set another one as default. When you're done, just begin
a modal session or run a sheet with the NSPanel.
Excellent tip!
-- Chris
--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Making Business Distributed | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.