[wxPython] wxComboBox <> combobox :(

Stano Paska stanislav.paska at kios.sk
Tue Jul 20 11:15:09 CEST 2004


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.


JZ wrote:
> 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>
> 
> --
> JZ







More information about the Python-list mailing list