wxPython TreeCtrl without showing root while still showing arrows

Posted by None on Stack Overflow See other posts from Stack Overflow or by None
Published on 2010-05-28T00:33:13Z Indexed on 2010/05/28 0:41 UTC
Read the original article Hit count: 235

Filed under:
|
|
|

I am making a python tree visualizer using wxPython. It would be used like so:

show_tree([ 'A node with no children', ('A node with children', 'A child node', ('A child node with children', 'Another child')) ])

It worked fine but it shows a root with a value of "Tree". I made it so that it would create multiple roots but then learned that I wasn't allowed to do that. I reverted to the original code but used changed it from this: self.tree = wx.TreeCtrl(self) to this: self.tree = wx.TreeCtrl(self, style=wx.TR_HIDE_ROOT). It worked but it didn't show the little arrows on the side so you wouldn't know which nodes had children. Is there any way to hide the root node but keep the arrows. Note: I am on a Mac using Python version 2.5 and wxPython version 2.8.4.0.

© Stack Overflow or respective owner

Related posts about python

Related posts about tree