Re: tree

Neil Hughes <[email protected]> Wed, 28 Oct 2009 11:24:03 +0000
Newsgroups gmane.comp.python.pythoncard
Organization Support4Omega Ltd.
Message-ID <[email protected]>
On 21/10/09 00:27, John Henry wrote:
> Does anybody have more examples on the tree control?  The minimum tree only show very simple functions and I'm able to do those.  But there is no information on how I can traverse the tree - start with the root, get to the NextChild, get the label, delete a branch, programmatically expand or contract a branch, ... - all the standard things one would do with a tree...

My use of the tree control hasn't been much more sophisticated than the 
example. I did add a couple of extra method aliases to 
PythonCard\components\tree.py because the ones already there are only 
enough to support the example. So in __init__ I added

setExpanded = wx.TreeCtrl.Expand
clearTree = wx.TreeCtrl.DeleteAllItems

so that having built the tree from a dictionary I could open up all of 
the nodes at startup, and I could tear it down and rebuild it 
differently later on.

-- 
Neil Hughes

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference