Control resizing itself
Vadim Zeitlin
vadim at wxwindows.org
Tue Aug 1 17:07:39 PDT 2006
On Tue, 01 Aug 2006 12:32:15 +0200 Joost <imim at newhouse.nl> wrote:
J> But then something happens which require the control to enlarge itself.
J> How should the control notify the sizer hierarchy that its best size has
J> changed?
It can't. The layout is never done from bottom to top in wxWidgets to
simplify things (or, rather, to avoid overcomplicating them even further).
You must call Layout() on the top level window/sizer.
J> And I tried Frame->Layout(), but that did nothing either (don't
J> understand shy).
Maybe because the controls best (a.k.a. minimal) size was cached. You
should call InvalidateBestSize() on the control itself.
J> Only when I resize the window (using the mouse), the control size gets
J> updated to the new size.
Hmm, then it's not the problem of cached best size.
J> I figure there should be some event that a control could send to a
J> sizer, which propagates upwards through the entire sizer hierarchy and
J> causes all sizes to be recalculated. Does such a mechanism exist?
No, not currently.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list