[wxPython] wxComboBox <> combobox :(

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JZ

    #1

    [wxPython] wxComboBox <> combobox :(

    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
  • Stano Paska

    #2
    Re: [wxPython] wxComboBox &lt;&gt; combobox :(

    You must use something like

    combo.Append('a aa', 'a')
    combo.Append('b bb', 'b')

    and when you want get value, use

    item = combo.GetSelect ion()
    value = combo.GetClient Data(item)

    read manual for more details...

    Stano Paska.


    JZ wrote:[color=blue]
    > 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[/color]




    Comment

    Working...