Hello, I am adding new UI to my audio plugin and a part of it involves clicking a text button that creates a call out box. On Windows, the call out box closes whenever the plugin is closed or another channel is clicked on. However, on Mac the call out box stays visible when the plugin is closed and when I click onto another channel. This is causing the DAW to sometimes crash. Does anyone know what I can do to make it so the call out box closes?
stemTypeButton.onClick = this
{
// Get the current selected stem type from the button text
juce::String currentSelectedStemType = stemTypeButton.getButtonText();
// Create the StemTypeSelectionComponent with the current selected stem type
// Using std::make_unique to create a unique_ptr
auto stemTypeSelectionComponent = std::make_unique<StemTypeSelectionComponent>(currentSelectedStemType);
// Set the callback to update the button text and dismiss the CallOutBox
stemTypeSelectionComponent->onSelectionChanged = [this](const juce::String& selectedStemType)
{
stemTypeButton.setButtonText(selectedStemType);
};
// Define the area the CallOutBox should point to
juce::Rectangle<int> areaToPointTo = stemTypeButton.getScreenBounds();
// Configure the content component's LookAndFeel and colors before launching
stemTypeSelectionComponent->setLookAndFeel(&customLookAndFeel);
// Launch the CallOutBox asynchronously
juce::CallOutBox& callOutBox = juce::CallOutBox::launchAsynchronously(std::move(stemTypeSelectionComponent), areaToPointTo, nullptr);
callOutBox.setLookAndFeel(&customLookAndFeel);
// Set properties on the CallOutBox
callOutBox.setArrowSize(0.0f);
};
