I try to have a callback to populate a ComboBox menu, but overriding showPopup() is tricky, because the default implementation uses a lot of private information.
It would be great to have a callback:
std::function<void (juce::PopupMenu*)> onShowPopupCallback;
My use case is that I have toggles in the menu which need to get the correct state on open.
combo.onShowPopupCallback = [this](juce::Popup* popup)
{
popup->addItem (juce::PopupMenu::Item ("toggle")
.setAction ([this]{ state = !state; })
.setChecked (state));
};
I can supply a PR if needed.
Cheers!
