Page 1 of 1

wxTreeCtrl, hidden root incompatible with ExpandAll() ?

Posted: Sat Aug 18, 2007 9:57 am
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 ?

Posted: Sat Aug 18, 2007 12:08 pm
by benedicte
You just need to store/get the root item (wxTreeItemId) and call ExpandAllChildren.

Posted: Sat Aug 18, 2007 1:05 pm
by DavidHart
Hi,

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

Regards,

David

Posted: Sun Aug 19, 2007 9:23 pm
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.

Posted: Mon Aug 27, 2007 5:08 pm
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.