X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..edcccd84c367a8c4f737edecf92a7b3904e95266:/src/gtk/control.cpp diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index dfbfe4b9c0..41f5cc4ea1 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/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