[wxPython-users] Scrollbar help with DynamicSashWindow
Danny Shevitz
shevitz at lanl.gov
Thu Mar 22 11:11:35 PDT 2007
>>so after a long hiatus, I tried to implement what you said, and I have
>>run into another problem
>>If I put the TreeCtrl inside a panel, I no longer seem to be able to bind
>>EVT_DYNAMIC_SASH_SPLIT to
>>the tree Ctrl.
>
>
>The DSW sends the event to what it thinks is the leaf window, which in
>this case would be the panel.
Yep, that works.
Time for the next question. I have now put the TreeCtrl in a Panel. The
size of the TreeCtrl is fixed, and the panel
is sized to fit. The problem is that the trees can grow arbitrarily large.
Is there a way to dynamically resize the
tree/panel so that the tree fits itself without it's own scrollbar. I tried
looking at
GetVirtualSize, GetBestSize,GetBestVirtualSize,GetEffectiveMinSize, etc.for
the tree to find what
virtual size it should be, but none of these methods seem to work.
In my test code, there were some glimmers of hope that, for instance,
GetEffectiveMinSize does what I want.
When I edited my root node to a really long string, it did give me
something larger than the explicit size of
the TreeCtrl, but on subsequent edits (making the label even longer).
GetEffectiveMinSize never seems to
change again.
In summary, is there a dynamic way to find the virtual size of the tree, so
that I can update the physical size
to always be the same size? Would I need to re-Fit the Panel after this
operation?
thanks,
Danny
More information about the wxpython-users
mailing list