I am using wxPython and got a tree with some items.
Now I need a function which give me the tree item object by name.
For example:
item = self.GetItemByName(“MyStories”)
I can not find such function in the documentation.
Does anyone has any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s one way to find the first tree item with a specific label:
But depending on what you’re displaying in the tree, there’s probably an easier way to handle it. The TreeCtrl already provides the tools to create references both ways between tree items and other objects as you fill the tree, and dict lookups are much faster and cleaner looking than what I just typed.