Feed wxComboBox with dictionary/hash

Iain King iainking at gmail.com
Thu Jun 22 10:59:48 EDT 2006


Roland Rickborn wrote:
> Hi folks,
>
> I am relatively new to Python. Although I read a lot of howtos,
> introductions and wikis, I am still having trouble ;-)
>
> My querstion:
> As the subject says, I'd like to feed a wx.ComboBox with a
> dictionary/hash. According to the posting of Stano Paska ("wxComboBox
> <> combobox", 20 Jul. 2004), there seems to be a way to do this:
>
> > You must use something like
> > combo.Append('aaa', 'a')
> > combo.Append('bbb', 'b')
> > ...
>
> My problem is:
> my data has thousands of entries. Therefore, I'd like to feed the
> combobox with a dictionary (which itself is fed by a database query).
>
> My first question:
> how can a wx.ComboBox be fed by a dictionary?
>
> For further help, Stano says:
>
> > read manual for more details...
>
> Ok, I'd like to. But which one?
> I was reading http://www.wxpython.org/docs/api/wx.ComboBox-class.html
> and didn't even find the above mentioned append method :-(
>
> TIA,
> Roland R.

wxComboBox inherits from wxControlWithItems (as does wx.ListBox, and
other controls which hold lists).  See:
http://wxwidgets.org/manuals/2.6.3/wx_wxcontrolwithitems.html#wxcontrolwithitems

Iain




More information about the Python-list mailing list