Hopefully an easy ListCtrl question
Hi everyone,
I am not sure why I am having so much trouble with this, but I am using
an EditableListBox, and appending items to it. I want to now select the
item that was just appended, but I can’t seem to figure out how in the
world to do this!
First of all, is there a better way to append items to the EditableListBox
than:
self.datumList.Strings = self.datumList.Strings+[datum]
where self.datumList is the EditableListBox? I current am doing:
insertPos = len(self.datumList.Strings)
itemID = self.datumList.ListCtrl.InsertStringItem(insertPos, datum)
and then to select it I am attempting:
self.datumList.ListCtrl.SetItemState(itemID, wx.LIST_STATE_SELECTED, wx.LIST_MASK_STATE)
but this isn’t working. That seems really awkward anyway. I am
surprised and kind of embarassed at what a hard time I have having
doing such a seemingly simple task in wxPython! Any help would
be greatly appreciated. Many thanks!
- Mike