Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
For trees, the best you can do using the standard control is to delay loading of child nodes until the node is expanded.
The true solution for large amounts of data is to use either the VirtualTree mix-in -> http://www.wxpython.org/docs/api/wx.lib.mixins.treemixin.VirtualTree-class.html or the mvctree module -> http://www.wxpython.org/docs/api/wx.lib.mvctree-module.html allowing you to store data in a convenient (and more appropriate) structure.
For text, there doesn't seem to be anything equivalent, but you might find that the StyledTextCtrl -> http://www.wxpython.org/docs/api/wx.stc-module.html is better suited (although anything thing that isn't virtualised won't cope well with huge amounts of text).
The closest thing is the DataViewCtrl -> http://docs.wxwidgets.org/stable/wx_wxdataviewctrl.html#wxdataviewctrl (which only deals with list data in wx2.8, but will have a tree variant in wx2.9)
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Question for y'all.
How can I speed up loading text into wx.TreeCtrl and wx.TextCtrl?
I'm using a basic while i < len(lines) loop.
Text is being appended in blocks of 10000 lines
Tree is being appended node by node.
Thanks.