[wxPython] wxComboBox <> combobox :(

J

JZ

Is there any way to fill wxComboBox with a dictionary, not a list?

All normal combobox widgets in HTML or Flash return id, not label. I would
like to display 'A', 'B' and return 'a' or 'b' similar to html:

<select>
<option value='a'>A</option>
<option value='b'>B</option>
</select>

wxWidget seems to work only like:

<select>
<option value='A'>A</option>
<option value='B'>B</option>
</select>
 
S

Stano Paska

You must use something like

combo.Append('aaa', 'a')
combo.Append('bbb', 'b')

and when you want get value, use

item = combo.GetSelection()
value = combo.GetClientData(item)

read manual for more details...

Stano Paska.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top