Add multiple TreeListCtrl objects on a Frame
I am new to wxPython. Can someone help me in:
How to add multiple TreeListCtrl on Frame/Panel like following:
First TreeListCtrl
show the tree and its child
Second TreeL开发者_StackOverflowistCtrl
show the tree and its child
Third TreeListCtrl
show the tree and its child
Second, what is the best way to implement a TreeListCtrl in wxPython like TreeList(shown in black border) shown in following image? Do i need to customize the default wxPython TreeListCtrl or is there any way without it? Any suggestions?
alt text http://www.freeimagehosting.net/uploads/b0b9583224.png
Actually, i want to show/add multiple root in the TreeList, i know this is not possible in wxPython, so what is the right way achieve such functionality?
Regards,
You CAN actually have multiple roots in practice; simply create a root node you don't care about, and add all the "roots" as children, then use the style which I think is wx.TR_HIDE_ROOT. This will have the desired effect of multiple top-level nodes.
I think you should be able to achieve a similar look with a TreeListCtrl. If not you can also check out CustomTreeCtrl, and perhaps there is also a CustomTreeListCtrl.
Will having multiple roots via the hidden parent root solve your problem of needing multiple controls? If not, just create a wx.Panel, give it a wx.BoxSizer(wx.VERTICAL), and call sizer.Add(treeCtrl1) et cetera for each one, then finally set that sizer as the panel's sizer. There are plenty of tutorials on sizers if you are not familiar with them.
精彩评论