wxTreeCtrl, hidden root incompatible with ExpandAll() ?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ioio
Experienced Solver
Experienced Solver
Posts: 61
Joined: Tue May 24, 2005 9:46 am

wxTreeCtrl, hidden root incompatible with ExpandAll() ?

Post by ioio »

I want to use a wxTreeCtrl with wxTR_HIDE_ROOT, but when tree's root is hidden, ExpandAll() runs an assertion.

So what's the matter ?
I know that a hidden root cannot be collapsed, that's just a feature isn't it ? But why is it not possible to run a full tree expansion with a hidden root ? The behaviour seems to be the same with wxTR_HIDE_ROOT, we must call AddRoot() and then add first childs to this wxTreeItemId... Why does the control doesn't manage the expansion/collapse under root lvl ?
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

You just need to store/get the root item (wxTreeItemId) and call ExpandAllChildren.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart »

Hi,

This has just been patched in svn. See http://svn.wxwidgets.org/viewvc/wx/wxWi ... p?view=log

Regards,

David
ioio
Experienced Solver
Experienced Solver
Posts: 61
Joined: Tue May 24, 2005 9:46 am

Post by ioio »

benedicte wrote:You just need to store/get the root item (wxTreeItemId) and call ExpandAllChildren.
This is wrong, ExpandAllChildren() gives an assertion as well on hidden root item.
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

ioio wrote:
benedicte wrote:You just need to store/get the root item (wxTreeItemId) and call ExpandAllChildren.
This is wrong, ExpandAllChildren() gives an assertion as well on hidden root item.
Apply the patch and you'll don't get anymore the assertion.
Post Reply