Search code examples
pythonwxpythonlistctrl

wxPython ListCtrl Help


I'm using a ListCtrl and it is populated with items on the fly, when an item is "Activated"(Double Click/Enter) it calls a function.

    def onClick(self, event):

How do I find out which item was clicked in the List since they don't have pre-set IDs? Is the String passed to the function as part of self or event?

Thanks.


Solution

  • Try event.GetText() or event.GetItem().<manipulate your item here>; here is wx.ListEvent documentation.