X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc2d42090058bb7ebb9545b857a9a435ecbdd876..f262b25c93c89d2f2bd0b388bac293c8969a2d72:/src/generic/statusbr.cpp diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index 958d61a5d9..163c13cab3 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -81,13 +81,14 @@ bool wxStatusBarGeneric::Create(wxWindow *parent, SetFont(*wxSMALL_FONT); #endif - // Set the height according to the font and the border size - wxClientDC dc(this); - dc.SetFont(GetFont()); - - wxCoord y; - dc.GetTextExtent(_T("X"), NULL, &y ); - + wxCoord y; + { + // Set the height according to the font and the border size + wxClientDC dc(this); + dc.SetFont(GetFont()); + + dc.GetTextExtent(_T("X"), NULL, &y ); + } int height = (int)( (11*y)/10 + 2*GetBorderY()); SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height);