X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d522606d0a1dfd22bcdc1a386b3dca01fa985e3..14a6b6e5f0200192944ed3d35ef4a3ce4549ac70:/src/gtk1/control.cpp diff --git a/src/gtk1/control.cpp b/src/gtk1/control.cpp index dfbfe4b9c0..41f5cc4ea1 100644 --- a/src/gtk1/control.cpp +++ b/src/gtk1/control.cpp @@ -92,6 +92,14 @@ wxSize wxControl::DoGetBestSize() const void wxControl::PostCreation(const wxSize& size) { wxWindow::PostCreation(); + + // NB: GetBestSize needs to know the style, otherwise it will assume + // default font and if the user uses a different font, determined + // best size will be different (typically, smaller) than the desired + // size. This call ensure that a style is available at the time + // GetBestSize is called. + gtk_widget_ensure_style(m_widget); + InheritAttributes(); ApplyWidgetStyle(); SetInitialBestSize(size); @@ -259,6 +267,5 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustm return attr; } - #endif // wxUSE_CONTROLS