# (Develop) AlertWindow Callback Response

**URL:** <https://forum.juce.com/t/develop-alertwindow-callback-response/50200>\
**Category:** General JUCE discussion\
**Created:** [February 15, 2022, 9:47pm UTC](https://forum.juce.com/t/develop-alertwindow-callback-response/50200 "2022-02-15T21:47:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbaine1](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@cbaine1](https://forum.juce.com/u/cbaine1)\
**Post date:** [February 15, 2022, 9:47pm UTC](https://forum.juce.com/t/develop-alertwindow-callback-response/50200/1 "2022-02-15T21:47:28Z")

</div>

The response in the lambda callback when using the `juce::AlertWindow(MessageBoxOptions&, std::function<void(int)>)` is in `1000->numButtons` range, instead of the `0->numButtons` range as expected. This was not true in Juce v6.1.2, and I haven’t had the chance to check if this is true with Windows yet.

```auto
juce::AlertWindow::showAsync(juce::MessageBoxOptions().withTitle("Title")
            .withMessage("Message")
            .withButton("Yes")
            .withButton("No")
            .withButton("Cancel"),
            [this](int response) { DBG("Response: " << response); });

```

---

<div class="post-metadata">

**Author:** ![nicolasdanet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nicolasdanet/32/56_2.png) [@nicolasdanet](https://forum.juce.com/u/nicolasdanet)\
**Post date:** [February 16, 2022, 6:33am UTC](https://forum.juce.com/t/develop-alertwindow-callback-response/50200/2 "2022-02-16T06:33:59Z")

</div>

See also:

> [@\[BR\] NativeMessageBox broken on macOS?](https://forum.juce.com/t/br-nativemessagebox-broken-on-macos/50100):
>
> Since (i guess) the recent change to allow associatedComponent in native message box on macOS… [https://forum.juce.com/t/fr-implement-associatedcomponent-for-nativemessagebox-on-macos/49555](https://forum.juce.com/t/fr-implement-associatedcomponent-for-nativemessagebox-on-macos/49555) … NativeMessageBox::showYesNoCancelBox doesn’t work anymore. The results are wrong (1001 1002 1003 / yes no cancel). Am i the only one? macOS BigSur / Xcode 12.5

---

<div class="post-metadata">

**Author:** ![cbaine1](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@cbaine1](https://forum.juce.com/u/cbaine1)\
**Post date:** [February 16, 2022, 12:43pm UTC](https://forum.juce.com/t/develop-alertwindow-callback-response/50200/3 "2022-02-16T12:43:27Z")

</div>

Oh, I didn’t see that in my search. Thank you, glad to hear I’m not the only one going crazy with it.
