SetItemHasChildren() for TreeListCtrl ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SetItemHasChildren() for TreeListCtrl ?

Philippe F
Dear wx users,

With the release of Phoenix, I can now work on my favorite hobby: porting the respectable Winpdb debugger to Python 3 / WxPython 4 (see https://github.com/bluebird75/winpdb if you are interested). It was initially written for WxPython 2.6 so it's quite a fast forward !

Winpdb uses TreeListCtrl and fails when looking for the method: SetItemHasChildren() . I chedked the 2.6 documentation and this is for forcing the display of the expansion symbol, so that the user can expand the item, and the program can lazily calculate the children list.

Is there an equivalent in WxPython 4 ? I saw a SetItemHasChildren() in wx.TreeCtrl but nothing similar for TreeListCtrl...

Thanks in advance,

Philippe F.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SetItemHasChildren() for TreeListCtrl ?

Robin Dunn
The new wx.dataview.TreeListCtrl is not the same class as the old wx.gizmos.TreeListCtrl. Rather it is just a very simplistic layer on top of the DataViewCtrl with a built-in data model. The classes in the wx.gizmos module hasn't been ported to Phoenix yet, and if it is I think I would rather have it as Python code instead of wrapped C++ code.

Due to being just a thin layer the wx.dataview.TreeListCtrl doesn't support "virtual" data via SetItemHasChildren like the old TreeListCtrl or wx.TreeCtrl, but the underlying DataViewCtrl does and is a lot more flexible. So you may want to look into switching to a DataViewCtrl with a custom DataViewModel for holding or generating the data to be displayed.  There is also AGW's HyperTreeList class.


Robin


On Wednesday, September 20, 2017 at 1:59:16 PM UTC-7, Philippe F wrote:
Dear wx users,

With the release of Phoenix, I can now work on my favorite hobby: porting the respectable Winpdb debugger to Python 3 / WxPython 4 (see <a href="https://github.com/bluebird75/winpdb" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fbluebird75%2Fwinpdb\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH_4VxwUlGIdlb0ndPAfyiKfySWrA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fbluebird75%2Fwinpdb\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH_4VxwUlGIdlb0ndPAfyiKfySWrA&#39;;return true;">https://github.com/bluebird75/winpdb if you are interested). It was initially written for WxPython 2.6 so it's quite a fast forward !

Winpdb uses TreeListCtrl and fails when looking for the method: SetItemHasChildren() . I chedked the 2.6 documentation and this is for forcing the display of the expansion symbol, so that the user can expand the item, and the program can lazily calculate the children list.

Is there an equivalent in WxPython 4 ? I saw a SetItemHasChildren() in wx.TreeCtrl but nothing similar for TreeListCtrl...

Thanks in advance,

Philippe F.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.