Is there any size limitation of CustomTreeControl

Hi,

In a wx.lib.customtreectrl, I am trying to load more then 7MB data in the
custom tree control. It is unable to load and also it hangs the system.

Is there any size limitation of wx.lib.customtreectrl?

Thanks,
Gopal

···

-----Original Message-----
From: Andrea Gavana [mailto:andrea.gavana@gmail.com]
Sent: Friday, December 14, 2007 12:58 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] PyAssertionError, while adding controls to
wx.ScrolledWindow

On Dec 13, 2007 10:58 AM, gopal mishra wrote:

In a wx.Dialog, I've added a wx.ScrolledWindow to the dialog and

dynamically

adding more then 1250 wx.StaticText controls in row wise to scrolled

window.

1250??? Wow, why do you need so many controls in a scrolled window?

I am getting the following error message:
Traceback (most recent call last):

<snip>
<snap>

PyAssertionError: C++ assertion "wxAssertFailure" failed at
..\..\src\msw\control.cpp(159) in wxControl::MSWCreateControl():
CreateWindowEx("STATIC", flags=52000100, ex=00000000) failed

Yes, Windows is going drunk because you're probably using too many GDI
resources to create more than 1000 widgets... If you need only static
texts, I'd suggest you to draw your text in the scrolled window using
a custom OnPaint method handling the wx.EVT_PAINT event for it. It's
much easier and far less resource-demanding than your current
approach.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

gopal mishra wrote:

Hi,

In a wx.lib.customtreectrl, I am trying to load more then 7MB data in the
custom tree control. It is unable to load and also it hangs the system.

Is there any size limitation of wx.lib.customtreectrl?

You'll be better off if you don't add everything to the tree initially, just add them on demand as nodes are expanded. I expect that this will work just like wx.TreeCtrl so for those items that have children but that are not added yet you can call SetItemHasChildren so it will make the node expandable. Then in the expanding and collapsing events you can add or remove the child items from the tree as needed.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi,

Hi,

In a wx.lib.customtreectrl, I am trying to load more then 7MB data in the
custom tree control. It is unable to load and also it hangs the system.

Is there any size limitation of wx.lib.customtreectrl?

The speed of CustomTreeCtrl depends mostly on how many items you have
to add and display. 7MB of data can be nothing if you add 1 item to
the tree with all the 7MB of data set as "pydata" in the item (using
SetPyData). I did some testing some month ago (adding 1800 items) on
CustomTreeCtrl and wx.TreeCtrl separately, and their performance were
not that far. CustomTreeCtrl, being a pure Python widget, is obvioulsy
a bit slower than the native wx.TreeCtrl, but the differences were
almost negligeable on my tests.

If you have *many* items in your CustomTreeCtrl, Robin's suggestion is
the way to go.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Jan 4, 2008 7:18 AM, gopal mishra wrote: