[wxPython] Problems with wxCheckListBox

Hi !
I got the following problem:

First of all i have a gadfly database i.e: [('1','Thomas'), ('0', 'Jacob'),
('1', 'SomethingElse')]

The 1 or 0 is the checkbox value. I fill out the checklistbox with the code:

import module1
database = module1.database()
def loadchecks(self):
  for x in database.LoadValues():
    x, y = (x[0], x[1])
    self.checkListBox.Check(int(x))
    self.checkListBox.Append(y)

This gives me the error: c:\Projects\wx\include\wx/dynarray.h(105): assert
failed. - Everytime i try to start the program.

If i comment the linie: self.checkListBox.Check(int(x)), it works(of course
without the checks, and only names)

Any suggestions on how to solve this?!

Thanks
Thomas

First of all i have a gadfly database i.e: [('1','Thomas'), ('0',

'Jacob'),

('1', 'SomethingElse')]

The 1 or 0 is the checkbox value. I fill out the checklistbox with the

code:

import module1
database = module1.database()
def loadchecks(self):
for x in database.LoadValues():
x, y = (x[0], x[1])
self.checkListBox.Check(int(x))
self.checkListBox.Append(y)

Look at the docs for Check again. YOu have to pass the item index to it as
well as the boolean value. Also, it would be kinda hard to check an item
that hasn't been added to the list yet. Try this:

    self.checkListBox.Append(y)
    self.checkListBox.Check(self.checkListBox.GetCount(), Getint(x))

···

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