Mon, Oct 21, 10:27 PM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: How can I speed up loading text into wx.TreeCtrl and wx.TextCtrl?


PhilC ( ) posted Sat, 09 April 2011 at 11:20 AM · edited Tue, 24 October 2023 at 5:09 AM

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.


nruddock ( ) posted Sat, 09 April 2011 at 12:55 PM · edited Sat, 09 April 2011 at 1:08 PM

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)


PhilC ( ) posted Sat, 09 April 2011 at 1:01 PM

Thanks, I'll look into that.


Privacy Notice

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.