git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43688
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
wxSize size = wxTreeCtrlBase::DoGetBestSize();
- // The generic control seems to have an implicit border
+ // there seems to be an implicit extra border around the items, although
+ // I'm not really sure where does it come from -- but without this, the
+ // scrollbars appear in a tree with default/best size
size.IncBy(4, 4);
+ // avoid caching (necessarily arbitrary) default size for empty tree
+ if ( GetRootItem().IsOk() )
+ CacheBestSize(size);
+
return size;
}