ComboBox with Icons and Text

Is there a way to use a ComboBox to display both an Icon and Text in the drop down list? Every example I’ve found so far simply adds text.

Yes, the Combo Box can generate User Widgets:

The only gripe is that you need to deal with that string rather than have a nice, clear enumerator. Scratch that, there is one now that can handle keys: - I guess you’d need to map some data.

It’s been a while since I used one :innocent:

Wish I could find an example of the ComboBox (Key) widget, every tutorial just does string, and every time I play with the key version it just doesn’t behave as expected.

Create a Name | Struct variable, populate it with info about the dropdown entries. Generate widget, look up key in the map → push struct into the widget, bind dispatchers.

If you need an example, do tell. Or if you have a question about the incorrect behaviour yiu’ve experienced, do ask.

Took a minute but based on your post above I was able to piece together what I was missing, thanks! Seems everyone leaves out that there are two different bindings that have to be setup for the ComboBox (Key) OnGenerateContentWidget and OnGenerateItemWidget. I’m guessing this is to allow for showing different things in your list vs selected, if you want the same Widget to be used then ComboBox (String) makes it simpler. Not sure if that is an accurate assessment though or if there is some other advantage to Key I’m missing.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.