Hi,
hi,
root = t.GetRootItem()
cookie = t.GetFirstChild( root ) [0]
c0 = t.GetNextChild( root, cookie )
c1 = t.GetNextChild( root, cookie )
…
i0,x0 = c0
now i try to get the label of child 0
t.GetItemText( i0 )
but result is empty string
Would think that would throw an error above as your passing an invalid cookie. Though it may just resolve to an invalid treeitem id when you call getnextchild.
Should look more like this, need to update the cookie each call to move to the next item.
root = t.GetRootItem()
firstChild, cookie = t.GetFirstChild(root)
c0, cookie = t.GetNextChild(root, cookie)
c1, cookie = t.GetNextChild(root, cookie)
t.GetItemText(c0)
is there a difference between text and label ?
Yes, depending upon the widget.
and what is x0 (second element in tuple returned by GetNextChild)
Its the next cookie to use for your next call.
what is the result of GetFirstChild()
Its a tuple of (TreeItem, cookie)
how do i use GetNextSiblings() ?
Pass it the TreeItemId of the item you want to get the next sibling of.
i.e.)
treeId, cookie = tree.GetFirstChild(rootNode)
nextChild = tree.GetNextSibling(treeId) # equivalent to ‘nextChild, cookie = tree.GetNextChild(rootNode, cookie)’
Cody
···
On Tue, Feb 26, 2013 at 9:36 AM, agraeper@googlemail.com wrote: