RE: [wxPython] Finding wxTreeItemId from data associated to a wxT reeItemData

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RE: [wxPython] Finding wxTreeItemId from data associated to a wxT reeItemData

Cavanaugh, Craig
Well, I used your suggestion and it works great.

I used the following:

self.treeDict[id(accounts[i])] = twig

and then do a:

twig = self.treeDict[id(dlg.parentAccount)]

when I need to find it.  I'm assuming that python will not change the id of
an object while it is in memory.


Thank you!

Craig

> -----Original Message-----
> From: Robin Dunn [SMTP:[hidden email]]
> Sent: Thursday, February 17, 2000 2:38 PM
> To: Cavanaugh, Craig; [hidden email]
> Subject: Re: [wxPython] Finding wxTreeItemId from data associated to
> a wxTreeItemData
>
> > I need to update
> > the tree when the list changes, but I do not know what the treeItemId is
> and
> > I do not want to store the treeItemId with the real data.
> >
>
> This is what I would suggest.  Or perhaps using an intermediate dictionary
> or
> something to map your data objects to tree IDs.
>
> --
> Robin Dunn
> Software Craftsman
> [hidden email]
> http://AllDunn.com/robin/
> http://AllDunn.com/wxPython/  Check it out!
>

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users