How to get the selected item in a wxListCtrl

Hi all,

maybe I am to stupid, but I just can't get the selected Item in a
wxListCtrl, to get the data out of the Item. I found lots of funktions
concerning the Item, but all of these require the Item-ID.
But how can I get this ID??

One way of doing it is by tracking EVT_LIST_ITEM_SELECTED events sent to
the control. The event raised has an attribute called "m_itemIndex" which
represents the ID of the newly selected item. Save that value and, when it
comes to getting the selected item, you have the item's ID.

Thanks,

Bjoern.

Cheers,

Jon.

Thanks Jon!

One way of doing it is by tracking EVT_LIST_ITEM_SELECTED events sent
to the control.

That helped...
... I wasn't stupid ... just blind ...

Bye,

Bjoern.

···

--
small office solutions
info@sosnetz.de - http://www.sosnetz.de

Jonathan Bills wrote:

Hi all,

maybe I am to stupid, but I just can't get the selected Item in a
wxListCtrl, to get the data out of the Item. I found lots of funktions
concerning the Item, but all of these require the Item-ID.
But how can I get this ID??

One way of doing it is by tracking EVT_LIST_ITEM_SELECTED events sent to
the control. The event raised has an attribute called "m_itemIndex" which
represents the ID of the newly selected item. Save that value and, when it
comes to getting the selected item, you have the item's ID.

You can also use some python helper methods I added a while back, GetFirstSelected and GetNextSelected.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!