CustomTreeCtrl and clicked item

Hi all,
I’m working with a CustomTreeCtrl class and I’m interesting in getting the item that I clicked (I set the multiple choiche option).

I would like to have an event that can do something like:
“Hey, you clicked on the item foo!”.

If I catch the event EVT_TREE_ITEM_CHECKED and I ask for the evt.GetItem() I get a CustomTreeCtrl instance, but I want to know which item has been clicked.

Any idea?
Thank you!

Robert.

Robert,

I think EVT_TREE_ITEM_ACTIVATED does what you are looking for.
From the docs: The item has been activated, i.e. chosen by double clicking it with mouse or from keyboard. Processes a wxEVT_TREE_ITEM_ACTIVATED event type

Cheers
Claudia

Hi,
thanks for answering…
any hint?

Thank you!

Robert

···

Robert,

I think EVT_TREE_ITEM_ACTIVATED does what you are looking for.
From the docs: The item has been activated, i.e. chosen by double clicking it with mouse or from keyboard. Processes a wxEVT_TREE_ITEM_ACTIVATED event type

Cheers
Claudia

any hint?

What do you mean?
This?

self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.on_double_click, id=wx.ID_ANY)

def on_double_click(self,e):
    _item = e.GetItem()
    print('{}'.format(_item.GetText()))

Cheers
Claudia

Yes, exactly!
Thank you very very much!

Robert

···

any hint?

What do you mean?
This?

self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.on_double_click, id=wx.ID_ANY)

def on_double_click(self,e):
    _item = e.GetItem()
    print('{}'.format(_item.GetText()))

Cheers
Claudia