Combobox error on windows

Hi again

While googling I found this solution:

        self.activity_combo.AppendItems(activities)
        self.activity_combo.SetSelection(0)

Is this the only way to populate the combobox control?

You can append items individually, or pass them during combobox creation
(the first line you provided before).

I personally prefer to stay away from the Create() method on all
wxPython objects, if only because I've never gotten it to work, I almost
always know what I want the object to contain in the first place, and
when I don't, I'm able to put the contents in later (as you are above).

If you move your db.getData() call before the wx.ComboBox() call, you
can just pass the choices during the wx.ComboBox() call.

- Josiah

···

Chetan Thapliyal <chetanthapliyal@gmail.com> wrote:

On 1/2/06, Chetan Thapliyal <chetanthapliyal@gmail.com> wrote:
>
> Hi list
>
> Can anyone tell me whats wrong with this code:
>
> self.activity_combo = wx.ComboBox(self, -1, choices=, style=
> wx.CB_DROPDOWN)
> activities = db.getData('.\\data\\activities.xml', 'activity')
> activities = activities.values()
> self.activity_combo.Create(self, choices=activities)
> self.activity_combo.SetSelection(0)
>
> I am getting the following error while executing the code on windows:
>
> return _controls_.ComboBox_Create(*args, **kwargs)
> wx._core.PyAssertionError: C++ assertion "!m_oldWndProc" failed in
> ..\..\src\msw
> \window.cpp(993): subclassing window twice?
>
> Its working fine on linux.
>
> Thanks
>
> regards
> Chetan
>
>