470,643 Members | 1,371 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,643 developers. It's quick & easy.

[wxPython] wxComboBox <> combobox :(

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>

--
JZ
Jul 18 '05 #1
1 2790
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



Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Donald Firesmith | last post: by
3 posts views Thread by ajay2552 | last post: by
reply views Thread by Guilherme Polo | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.