[wxPython-users] TreeCtrl GetNextSibling

Oswaldo Hernández listas at soft-com.es
Fri Feb 16 03:41:31 PST 2007


Werner F. Bruhin escribió:
> Hi Oswald,
> 
> Oswaldo Hernández wrote:
>> Hello all,
>>
>> I loop over items on a tree control using 'GetNextSibling', but when i 
>> check if there are more siblings i got an excepction:
>>
>> h = Tree.GetNextSibling(h)
> You are checking to late if "h" is a o.k.
>> if h.IsOK() == False:
>>     Error: AttributeError: 'TreeItemId' object has no attribute 'IsOK'
>>
> What about something along these lines:
>        (child, cookie) = tree.GetFirstChild(root)
>        while child.IsOk():
>            print child
>            child = tree.GetNextSibling(child)
> 

Thanks for your reply Werner, but i have the same error:

h = Tree.GetFirstChild(item)[0]
while h.IsOK():
	....
	h = Tree.GetNextSibling(h)

AttributeError: 'TreeItemId' object has no attribute 'IsOK'


I'm using python 2.5, wx 2.8.0.1 (msw-unicode)
Windows XP
	
??????

-- 
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************




More information about the wxpython-users mailing list