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: Charles Srstka <email@hidden>
- Date: Tue, 15 Oct 2002 19:05:12 -0500
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.
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.
Charles
On Monday, October 14, 2002, at 12:10 PM, Stiphane Sudre wrote:
Problem:
You want a dialog to have a standard alert sheet/dialog to have a OK
and Cancel button.
You want the Cancel button to be the default button.
You don't want to have a Windows-like interface like in iCal when you
delete a Calendar (i.e. the OK button is on the left, the Cancel
button on the right).
Question:
How can you do this with the standard Alert Sheet/Dialog APIs?
Is the only solution to use a custom dialog/sheet?
_______________________________________________
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.
_______________________________________________
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.