Page 1 of 1

Find an object by its ID

Posted: Thu Aug 21, 2008 8:39 pm
by RossGK
Hi all - Just found this user group, so this is my 1st post! No doubt an easy one - at least I hope so...

If I've assigned meaningful ID's to a bunch of programatically created wxStaticText's and then need to find one later, what is the syntax for that?
I'm thinking there must be something like:

oldTextItem = myPanel.getItemByID(myIDrange+3)

where I had earlier created a series of items with

myIDrange = 5000
for i in Range(someRange):
t = wx.StaticText(myPanel, myIDrange+i,"random txt")

Hope there's something like that. I came across GetChildren, but presumably that gives me a list of all the items in myPanel, and I'd have to loop through the whole list and compare ID's - doable but rather verbose.

Thx in advance... Ross.
(PS. forgive any obvious syntax crazies in my awkward example above :) )

Posted: Thu Aug 21, 2008 8:52 pm
by doublemax