Hi all!
I have the following lines of code to show an alert window with Ok/Cancel options in my JUCE app.
const auto callback = juce::ModalCallbackFunction::create([this](int result) {
if (result) {
// Do something
}// result == 1 means you click OK
else {
// Do something else
}// result == 0 means you click Cancel
});
juce::AlertWindow::showOkCancelBox(juce::MessageBoxIconType::WarningIcon, "MyTitle", "MyMessage", "Ok", "Cancel", nullptr, callback);
It was working fine on JUCE 7.0.1 (I would get result == 1 when pressing Ok and result == 0 when pressing Cancel) but we had to upgrade our working JUCE version to 7.0.10.
Now (on Windows) no matter what button I press on the window, the callback gets called with a result value of 1. I’ve checked and I’m getting the same behavior on 7.0.7, 7.0.9 and 7.0.12. This appears to be working fine on MacOS.
Any idea of what could be causing this?
Thanks!
