CustomTreeCtrl and clicked item

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CustomTreeCtrl and clicked item

robert.pelson1
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.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CustomTreeCtrl and clicked item

Claudia Frank

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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CustomTreeCtrl and clicked item

robert.pelson1
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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CustomTreeCtrl and clicked item

Claudia Frank

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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: CustomTreeCtrl and clicked item

robert.pelson1
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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.