 |
 |
bug in NSAlert?
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2002
Location: Brooklyn, NY
Status:
Offline
|
|
Hi,
Has anybody tried adding more than 4 buttons to an NSAlert? Whenever I do, I get runtime exceptions. If you add more than 4 buttons, it throws the exception on the last one, regardless of how many. Does this happen to anyone else? I've checked the documentation and there's no mention of a limit of 4 buttons, so I don't think that's the problem.
I've tried os 10.3.1 and 10.3.4, xcode 1.1 and 1.2 (not that that should change it).
Is this a known bug?
gabe
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Three buttons is all you get.
From the docs for one of the NSAlert's:
Creates and runs an alert sheet on docWindow, with the title of title, the text of msg, and buttons with titles of defaultButton, alternateButton, and otherButton
The vargs are for other properties, but not buttons.
Matt Fahrenbacher
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Originally posted by Ghoser777:
Three buttons is all you get.
From the docs for one of the NSAlert's
You're looking at the wrong thing. Zimwy was referring to the NSAlert class:
The NSAlert class, which was introduced in Mac OS X v10.3, supersedes the functional Application Kit API for displaying alerts (NSRunAlertPanel, NSBeginAlertSheet, and so on). The former API is still supported, but you are encouraged to use the NSAlert class for your application’s alert dialogs.
This class purports to support more than 3 buttons:
If you have more than three buttons on your alert, the button-position return value is NSAlertThirdButtonReturn + n, where n is an integer. For languages that read right to left, the first button’s position is closest to the left edge of the dialog or sheet.
I just had a quick play and found the same thing that Zimwy did - it randomly breaks and throws an exception if you have more than 4. This appears to be a bug.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: May 2002
Location: Brooklyn, NY
Status:
Offline
|
|
Okay, wonderful. I've submitted the bug to apple. It's surprising that nobody's tried to add more than 4 buttons yet.
gabe
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
I forgot about that class... this is what happens when you essentialyl stop programming for 9 months.
Matt Fahrenbacher
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Ghoser777:
I forgot about that class... this is what happens when you essentialyl stop programming for 9 months.
NSAlert was just added in Panther. If you haven't been using Cocoa in the past nine months, I'm not surprised you didn't notice it. I have been using Cocoa, and I still only barely noticed it.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
You mean you don't rabidly read the release notes to see what's new with every release? Wow, weirdos. 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|