Get PopupMenu Item Icon In ComboBox

With the root menu available from the ComboBox class, it’s nice, easy, and tidy to add custom dropdown items with icons to the ComboBox PopupMenu, the issue is however, there’s no current way to access these icons from the ComboBox menu itself, as far as i can tell…

The desired functionality would be something like

getCurrentlySelectedItem()->getIcon()

so that one could have a PopupMenuItem with a custom Icon, and then pull this PopupMenu’s icon into the paint routine of the parent ComboBox & display the selected items Icon.

Is there an ability to do this which I haven’t seen?

Thanks,

Jake

Bump,

I’ve move this to feature requests.

Request: add ability to obtain PopupMenu::Item Icon from JUCE ComboBox class

1 Like

Did this ever happen?

You got my upvote on this. Strange that this functionality seems to be missing after all these years. I’d add though that the functionality needed to obtain the icon might be better implemented in PopupMenu, since you can already get the root menu from the ComboBox.

It would be nice also if the ComboBox would display the icon of the currently selected item by default… Or at least have an option to display it without having to re-implement some of the painting code.

Did you find any workaround in the meanwhile?