avoiding nesting dcs on the same window concurrently

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2006-10-20 11:01:50 +00:00
parent f2ee37d5ae
commit 8168167976

View File

@ -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);