[wxPython] Problems with wxCheckListBox

hi all,

i've a problem using

    wxCheckListBox::SetString

a call to this method crashes my program. i've checked the parameters and
they are correct. code from my programm follows: the wxCheckListBox
represents a collection of layers which can be enabled/disabled using the
checkboxes. the list is updated in the Refresh method of the parent object
(which is a wxPanel in my case).

    # this is the method, self.layer_list is the wxCheckListBox

    def Refresh(self):
        project = Project()
        layers = project.layers
        self.layer_list.SetSelection(project.active_layer)
        for layer in range(len(layers)):
            # the following call will crash without a traceback, but with a
exception from XP
            self.layer_list.SetString(layer, project.layer[layer].name)
            self.layer_list.Check(layer, project.layer[layer].enabled)
        wxPanel.Refresh(self)

does anyone have experience with the wxCheckListBox? has this problem
occured before? i'll try to create a smaller test-case to reproduce the
problem but maybe someone can help me beforehand. i played around a bit
(using wxCheckListBox::SetStringSelection which seems to have the same
problem) and it seems that a assert is triggered in the wxWindows code
(something about a wrong string, but i'm not sure) but i'm not wxWindows
expert.

i'm using Python 2.2, wxPython 2.3.2.1 running on a Win XP box.

thanks for your help,
kaweh

            self.layer_list.SetString(layer, project.layer[layer].name)

I've just fixed a bug here and checked it in. AS a workaround until the
next release you can use Clear and then Append the items to the list again
as a way of updating it.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

great! and thanks for the fast response.

awesome work you've put into wxPython.

regards,
kaweh

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Tuesday, February 12, 2002 12:10 AM
Subject: Re: [wxPython] Problems with wxCheckListBox

> self.layer_list.SetString(layer, project.layer[layer].name)

I've just fixed a bug here and checked it in. AS a workaround until the
next release you can use Clear and then Append the items to the list again
as a way of updating it.

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users