Multiple columns for ComboBox drop down

I would like to customize the ComboBox so that it displays items in multiple columns if there are more than 25 items in the ComboBox list, instead of filling a single column and stretching the popup menu beyond the size of the UI to the edges of the screen. I’ve looked through the docs, and the LookAndFeel classes, but I don’t see an immediate way to do this yet. Does anyone have experience or code they can share with this type of functionality?

PopupMenu::Options MyLookAndFeel::getOptionsForComboBoxPopupMenu(ComboBox& b, Label& l)
{
    return ParentLookAndFeel::getOptionsForComboBoxPopupMenu(b, l).withMinimumNumColumns(b.getNumItems() / 25 + 1);
}
1 Like

Thanks for sharing the code TurboCyber, but I already figured it out awhile ago. I’m sure your post will be helpful to others in the future though.