The following will put all the selected (highlighted) rows into a list.
There is probably a more elegant way to do it but this works.
row = -1
selected_items = []
while 1:
row = ListCtrl.GetNextItem(row, wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED)
if row==-1:
break
selected_items.append(row)
Steve
···
-----Original Message-----
From: Jacek Politowski [mailto:jp@jp.pl.eu.org]
Sent: Thursday, May 22, 2003 8:31 AM
To: wxPython-users@lists.wxwindows.org
Subject: [wxPython-users] GetSelection() for wxListCtrl ?
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
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org