2

I have a scrolled window and I am placing multiple tree control in the scrolled window. When ever i add more child items to the root of any treectrl it creates a scrollwindow to make sure all child will be accessible. What i need to achieve is increase in size allocated to tree ctrl instead of scrolled window. How do i achieve this

StraightCirle
  • 182
  • 2
  • 12

1 Answers1

2

I think there is no automatic method that can do this. You will have to implement it manually, i.e. when you are done with the insertions you explicitly invoke a resize of the control. Here the C++ code snippet, taken from this question

treeCtrl->InvalidateBestSize();
treeCtrl->SetClientSize(treeCtrl->GetBestSize());

The Python version should not be very different – probably the -> operators will have to be replaced by dots.

Community
  • 1
  • 1
Alberto M
  • 1,057
  • 8
  • 24
  • Thanks alberto for your response. I solved this problem with treeCtrl->setMaxSize(wxDefalultSize) command. This will resize the treectrl winow as and when the number of children is increased. – StraightCirle Sep 16 '15 at 05:13
  • OK, though my answer did not fit your case I am happy to know that your issue is solved. Maybe your solution will be useful for my future projects too. – Alberto M Sep 16 '15 at 14:00