Find an object by its ID Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
RossGK
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Aug 21, 2008 8:31 pm

Find an object by its ID

Post by RossGK » Thu Aug 21, 2008 8:39 pm

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 :) )

User avatar
doublemax
Moderator
Moderator
Posts: 15176
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Thu Aug 21, 2008 8:52 pm

Use the source, Luke!

Post Reply