I have wxListCtrl and wxButton (remove).
I'd like to remove selected item from wxListCtrl
For wxListBox I've used foobar.Delete(foobar.GetSelection()), but for
wxListCtrl I can't find anything similar to GetSelection().
wxListCtrl have DeleteItem() method, which seems to work fine, but how
to pass item (row) ID to this method?
Is there any simple way for doing this?
TIA
···
--
Jacek Politowski
Robin
2
Jacek Politowski wrote:
I have wxListCtrl and wxButton (remove).
I'd like to remove selected item from wxListCtrl
For wxListBox I've used foobar.Delete(foobar.GetSelection()), but for
wxListCtrl I can't find anything similar to GetSelection().
wxListCtrl have DeleteItem() method, which seems to work fine, but how
to pass item (row) ID to this method?
Is there any simple way for doing this?
The wxPython version of the wxListCtrl has these helper methods added:
def GetFirstSelected(self):
'''return first selected item, or -1 when none'''
return self.GetNextSelected(-1)
def GetNextSelected(self, item):
'''return subsequent selected items, or -1 when no more'''
return self.GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!