X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..14a6b6e5f0200192944ed3d35ef4a3ce4549ac70:/src/gtk1/control.cpp diff --git a/src/gtk1/control.cpp b/src/gtk1/control.cpp index 7f5b15bf08..41f5cc4ea1 100644 --- a/src/gtk1/control.cpp +++ b/src/gtk1/control.cpp @@ -4,7 +4,7 @@ // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling, Julian Smart and Vadim Zeitlin -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -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