473,705 Members | 5,438 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 recursiveFindIt emByPydata(self , parent, pydata):
* * item, cookie = self.GetFirstCh ild(parent)
* * while item:
* * * * if self.GetPyData( item) == pydata:
* * * * * * * * return item
* * * * * * * * * * * * * * * *
* * * * if self.ItemHasChi ldren(item):
* * * * * * found = self.recursiveF indItemByPydata (item, pydata)
* * * * * * if found is not None:
* * * * * * * * return found
* * * * * * *
* * * * item, cookie = self.GetNextChi ld(parent, cookie)
* * return None


Aug 18 '06 #1
0 1299

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

Similar topics

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 len(list(iterator))... Anything better? Thanks, Thorsten def part(seq, func):
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 I've also looked through Slipstick, and Sue's book. Most of that is geared towards VB 6 it seems. Here is the code snippet Sent_Folder = objNS.GetDefaultFolder Outlook.OlDefaultFolders.olFolderSentMail)
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 I do
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 got from external xml file. when the particular parent field is selected and dragged, it must get posted to the other sash window which should in TreeList Control, bcoz iam displaying numerous xml attributes of the parent and following
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 an object of type 'WindowsApplication10.Form1+DictionaryExt`2' was not found." Source="mscorlib" You can just past the snippet on any form with a button.
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 I would like to give those related DataGridViewRows a different BackColor. Thanks for hints and help! Rainer
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 does nothing. I would expect to see some code on how to create a folder but all I see is a description a shortcut and an author, no code snippet? -Lou
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 added such that the list gets too large to be displayed, the scrollbars appear. Once this occurs, the last item though selected and focused (highlighted blue), will not appear within the viewable area since the listview requires a scrolldown. This...
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 so, set up variables: $name = $_POST; $ribbon = $_POST;
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.