SetStringItems, wxListCtrl and modify items

Hi,

I'm using a wxListCtrl in mode Report. My problem is that sometimes I can't modify the cell values with SetStringItem and other times I can do it.

is there any bug?
It seems like the list has lost the items. It's possible?

I'm working with many threads and it's possible that modify different items of the wxlistctrl at the same time

Is there another way for modifying the items instead of 'SetStringItem' ???

Thanks

Jose wrote:

I'm using a wxListCtrl in mode Report. My problem is that sometimes I can't modify the cell values with SetStringItem and other times I can do it.

is there any bug?
It seems like the list has lost the items. It's possible?

I'm working with many threads and it's possible that modify different items of the wxlistctrl at the same time

My first guess would be that this (multiple threads accessing the control) is exactly the problem. You probably have two threads trying to act on the wxListCtrl and interfering with each other. Can you duplicate the problem in a single-threaded case?

It's never a good idea to have multiple threads interacting with the GUI system -- wxWindows (and thus wxPython) are not designed to be thread-safe. You should designate a single thread as the GUI thread (the one in which you initialize your wxApp), and have all direct access to any wxPython widgets go through that thread. Use some method (wxPostEvent, queue.Queue, etc) to have other threads request that specific actions be taken by the GUI thread.

Jeff Shannon
Technician/Programmer
Credit International