Control resizing itself

Armel Asselin armelasselin at hotmail.com
Tue Aug 1 07:39:05 PDT 2006


> I've implemented DoGetBestSize() to return the optimum size. Initially 
> this works fine, upon startup my control is made the right size.
>
> But then something happens which require the control to enlarge itself. 
> How should the control notify the sizer hierarchy that its best size has 
> changed?
>
> I tried GetContainingSizer()->Layout(), but this does nothing, probably 
> because it does not propagate to the parent sizers. And I tried 
> Frame->Layout(), but that did nothing either (don't understand shy). And 
> the control really should not know anything about the window anyway. Only 
> when I resize the window (using the mouse), the control size gets updated 
> to the new size.
there is a call to invalidate the best size of a control, would it do what 
you want? (before a Layout( ) call)

Armel 








More information about the wx-users mailing list