[wxPython-users] about customtreectrl.GenericTreeItem
Andrea Gavana
andrea.gavana at gmail.com
Sun Jul 22 19:02:44 PDT 2007
Hi Lee,
On 7/22/07, Lee DYER wrote:
> I used a=tree.GetFirstChild(item) to get the firstitem of the item
> object,the return value is an instance of customtreectrl.GenericTreeItem,is
> it right?
>
> but why I can't use the the return value to get the parent like this
> :a.GetParent()
>
> the Trace says a tuple don't have the GetParent method
>
> so the retuan value is a tuple?I modify the code like a[0].GetParent() ,it
> works
>
> who can explain why ?
GetFirstChild (and GetNextChild) returns a tuple: the first element of
the tuple is the GenericTreeItem, the second one is a so called
"cookie", which can be used to recurse over all children of a
particular item:
child, cookie = self.GetFirstChild(item)
while child:
# do something with child
child, cookie = self.GetNextChild(item, cookie)
HTH.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
More information about the wxpython-users
mailing list