How to read a wxTreeCtrl

danielpm72 danielpm72 at yahoo.es
Tue Apr 5 04:32:01 EDT 2005


Hi,

I want to read a wxTreeCtrl from the root since I want to store all 
the information in it in a python dictionary. I know that the methods 
I have to use are ItemHasChildren, GetFirstChild and GetNextChild and 
I have been success in getting the first node in this manner:

 while child.IsOk():
            print wx.TreeCtrl.GetItemText ( self, child )  
            if wx.TreeCtrl.ItemHasChildren ( self, child ):
                (child, cookie) = wx.TreeCtrl.GetNextChild( self,    
child, cookie )
            else:
                (child, cookie) = wx.TreeCtrl.GetNextChild( self, 
child, cookie )

my problem is that each one of this nodes has others children whose 
has its values. How can I read more that one level? 

Thanks in advance,


Daniel del Pozo








More information about the Python-list mailing list