MessageBoxOptions creates opposite results for AlertWindow vs NativeMessageBox

On a Mac, building with Juce 6…

Using the same MessageBoxOptions object, and going between using AlertWindow::show vs 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 1.

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.

This sounds familiar. It’s definitely worth testing with JUCE 7 to see whether the issue has already been fixed.

Yeah, good to check that, but a build with JUCE v7.0.2 produced the same results.

Were you able to verify this on your end?