I have to manually recreate the ListCtrl after selection, but the following code doesn't work (no selection is made).
What do I do wrong?
IIRC, there is some internal cleanup that the control does after deleting all items. That is probably also clearing the selection. So if you delay your reselection for a short time then it should work fine for you, something like this:
Thanks Robin. This works, but only when set for 150ms or more.
Is there a way to make sure I'm on the safe side? I can't just increase the delay in ms. I tried to do the same with CallAfter, but it won't work either.
···
On Fri, 19 Jan 2007 19:53:09 +0100, Robin Dunn <robin@alldunn.com> wrote:
IIRC, there is some internal cleanup that the control does after deleting all items. That is probably also clearing the selection. So if you delay your reselection for a short time then it should work fine for you, something like this:
def refreshGui(self, id):
self.lista.DeleteAllItems()
self.populateList()
wx.CallLater(100, self.afterRefresh, id)
Thanks again,
Igor
--
Igor Jese, igor@jeseonline.com