CheckboxList Item Deletion error

Hi,

I am working on a utility in wxPython (latest stable 2.8 version) on WinXP with Python 2.4. In it, I want to delete folders. I am currently using a CheckboxList to list the folders. My idea was to allow the user to check the ones that need to be deleted. It does work, but when I refresh the widget by doing a Clear() and then an AppendItems() and try to delete something else in the new list, I get the following traceback:

Traceback (most recent call last):
  File "//someserver/repl$/Scripts/PythonPackages/Development/scrubber_src.pyw", line 260, in deleteProfile
    if self.profile_cblb.IsChecked(count):
  File "C:\Python24\lib\site-packages\wx-2.8-msw-ansi\wx\_controls.py", line 1462, in IsChecked
    return _controls_.CheckListBox_IsChecked(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "IsValid(uiIndex)" failed at ..\..\src\msw\checklst.cpp(395) in wxCheckListBox::IsChecked(): bad wxCheckListBox index

My questions are as follows:

1) How do I fix this?
2) Should I use a different widget, like some kind of Tree control?

I assume that the index is not getting updated for some reason, but I don't know how to reset it. Maybe a refresh of the entire GUI?

Thanks a lot!

Mike Driscoll
Applications Specialist
MCIS - Technology Center
1 E. Main St.
Marshalltown, IA 50158
mdriscoll@co.marshall.ia.us