Since r57627 wxStaticText objects with wxST_NO_AUTORESIZE flag created with
wxDefaultSize were created with zero width. This accounted for the
disappearance of the labels for the toolbar controls (as could be seen in the
toolbar sample where the combobox label was not shown any more).
Fix this by explicitly setting the correct initial size after the correct
label is set.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62935
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// need to do many operation on it for ellipsization&markup support
SetLabel(label);
+ // as we didn't pass the correct label to MSWCreateControl(), it didn't set
+ // the initial size correctly -- do it now
+ InvalidateBestSize();
+ SetInitialSize(size);
+
// NOTE: if the label contains ampersand characters which are interpreted as
// accelerators, they will be rendered (at least on WinXP) only if the
// static text is placed inside a window class which correctly handles