Skip to content Skip to sidebar Skip to footer

Wxpython Wx.evt_list_item_selected Not Working When Same Item Is Clicked Twice In A Row

I have the below code for a wxPython panel in which I am trying show the user all the states, but I only want them to be able to select (or check) either Massachusetts or New York.

Solution 1:

EVT_LIST_ITEM_SELECTED is only fired when the item is first selected. You can't select an already selected item. You could bind to EVT_LEFT_DOWN and grab the position of the mouse. Then in the handler, you would use myListCtrl.FindItemAtPos() and pass the position to it. Something like that should work.

Solution 2:

You would want to use a mouse click event rather than an item selected event; Mike Driscoll is right.

Post a Comment for "Wxpython Wx.evt_list_item_selected Not Working When Same Item Is Clicked Twice In A Row"