473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

find item in wx.TreeListCtrl by pydata code snippet

Hello list,

here is a small code snippet to recursively search a wx.TreeListCtrl for an
item with specific pydata.

Feel free to comment!
def recursiveFindItemByPydata(self, parent, pydata):
* * item, cookie = self.GetFirstChild(parent)
* * while item:
* * * * if self.GetPyData(item) == pydata:
* * * * * * * * return item
* * * * * * * * * * * * * * * *
* * * * if self.ItemHasChildren(item):
* * * * * * found = self.recursiveFindItemByPydata(item, pydata)
* * * * * * if found is not None:
* * * * * * * * return found
* * * * * * *
* * * * item, cookie = self.GetNextChild(parent, cookie)
* * return None

HAND

Johannes
Aug 18 '06 #1
0 1287

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Thorsten Kampe | last post by:
What is the best way to find out the length of an iterator? len() doesn't work. In the above code snippet I am only interested in the index (= length of the iterator), so I'm using...
0
by: Jason Ferree | last post by:
I am trying to process all folders in a "sent items" folder in outlook 2000. Most items are of "mail Item" type, but some are of an appointment item type. I've looked through the newsgroups, and...
18
by: Mike Bartels | last post by:
Hi Everyone! I have two Arrays A and B. Both arrays are byte arrays with 7 bytes each. The contents of array A and B are the same A = {1, 2, 3, 4, 5, 6, 7}; B = {1, 2, 3, 4, 5, 6, 7}; When...
0
by: sendhil kumar | last post by:
Hi all, whwn working with xml connectvity to python, i have a sash window, in which first window has a Tree Control that has 'n' parent fields preceded by + sign and on leftdown all the childs...
6
by: pamela fluente | last post by:
Hi, please find below a very simple code snippet which is giving me the following error: System.Runtime.Serialization.SerializationException was unhandled Message="The constructor to deserialize...
5
by: Rainer Queck | last post by:
Hello NG, what would be the best way to locate a DataRrow in a DataGridView? I have by DataTable.Select a bunch of DataRows from a DataTable (which is the data source to the DataGridView). Now...
2
by: Lou | last post by:
Under the tools menu I see a menu for "Code Snippets Manager" I open and see some wonderful stuff but how do you use it? Example, if I choose "File System" and then choose "Create a folder" it...
0
by: inandout | last post by:
Hi, I was wondering if anyone can help me with this. I have a listview that is specified to a size of: 348W x 308H When items are added to it, no problems. However when items continue to be...
4
by: chrism | last post by:
Hello, I'm hoping someone can help me out here. I'm building a shopping cart using sessions, populating with $_POST values from a form. Code abbreviated below: check if form is submitted. if...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.