On a Mac, building with Juce 6…
Using the same
MessageBoxOptions object, and going between using
NativeMessageBox::show, I get opposite button order in the dialog box’s layout. This issue is more than cosmetic – since those methods return an
int that is “the index of the button that was clicked”, you actually get opposite results for them!
MessageBoxOptions options = MessageBoxOptions() .withIconType (MessageBoxIconType::WarningIcon) .withTitle ("Here's a question for you...") .withMessage ("Will it be Yes/No or No/Yes?") .withButton ("Yes") .withButton ("No"); int buttonClicked; buttonClicked = NativeMessageBox::show (options); DBG ("the index of the button that was clicked was: " + String (buttonClicked)); buttonClicked = AlertWindow::show (options); DBG ("the index of the button that was clicked was: " + String (buttonClicked));
Clicking the Yes button in the NativeMessageBox returns a
0, but clicking the Yes button in the AlertWindow returns a
So, is this an idiosyncrasy of the two formats, or a bug? If it’s a consistent idiosyncrasy, I could program around it… but if it’s a bug that will be fixed, then my workaround would break when it was fixed.