wx.TreeCtrl Bug or ?

When you create a wx.TreeCtrl with style:

wx.TR_HIDE_ROOT|wx.TR_HAS_VARIABLE_ROW_HEIGHT|wx.TR_DEFAULT_STYLE

issuing command self.CollapseAll() throw this error:

self.CollapseAll()
  File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx
\_controls.py", line 5513, in CollapseAll
    return _controls_.TreeCtrl_CollapseAll(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "!IsHiddenRoot(item)" failed
at ..\..\src\msw\treectrl.cpp(1727) in wxTreeCtrl::DoExpand(): Can't
expand/collapse hidden root node!

Is it a bug or....?

Prashant
Python 2.6.2
wxPython 2.8.10.1
XP 32

No, it means exactly what it says. CollapseAll is trying to collapse the root node and that is not allowed. You'll need to collapse all the first level items yourself instead.

···

On 1/19/10 5:28 AM, King wrote:

When you create a wx.TreeCtrl with style:

wx.TR_HIDE_ROOT|wx.TR_HAS_VARIABLE_ROW_HEIGHT|wx.TR_DEFAULT_STYLE

issuing command self.CollapseAll() throw this error:

self.CollapseAll()
   File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx
\_controls.py", line 5513, in CollapseAll
     return _controls_.TreeCtrl_CollapseAll(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "!IsHiddenRoot(item)" failed
at ..\..\src\msw\treectrl.cpp(1727) in wxTreeCtrl::DoExpand(): Can't
expand/collapse hidden root node!

Is it a bug or....?

--
Robin Dunn
Software Craftsman