• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to avoid a Windows interface on OS X?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: How to avoid a Windows interface on OS X?
      • From: Chris Hanson <email@hidden>
References: 
 >How to avoid a Windows interface on OS X? (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: NSButtonCell subclass not working
  • Next by Date: button text
  • Previous by thread: Re: How to avoid a Windows interface on OS X?
  • Next by thread: Re: How to avoid a Windows interface on OS X?
  • Index(es):
    • Date
    • Thread