X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5edef14ec87e7fe2e1c48ed5f1a466ba60ece81a..984e8d0b6b939898447794fc1af930651c66abe6:/src/gtk/control.cpp diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 053f18f1ea..c12735e39b 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -33,6 +33,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow) wxControl::wxControl() { m_needParent = TRUE; + m_createComplete = false; } bool wxControl::Create( wxWindow *parent, @@ -43,6 +44,7 @@ bool wxControl::Create( wxWindow *parent, const wxValidator& validator, const wxString &name ) { + m_createComplete = false; bool ret = wxWindow::Create(parent, id, pos, size, style, name); #if wxUSE_VALIDATORS @@ -68,6 +70,14 @@ void wxControl::SetLabel( const wxString &label ) } } +void wxControl::PostSetLabel() +{ + // make sure the widget has been created, and that PostCreate has already + // been called + if (m_widget && m_createComplete && GetAdjustMinSizeFlag()) + SetBestSize(wxDefaultSize); +} + wxString wxControl::GetLabel() const { return m_label; @@ -103,6 +113,7 @@ void wxControl::PostCreation(const wxSize& size) InheritAttributes(); ApplyWidgetStyle(); SetInitialBestSize(size); + m_createComplete = true; } @@ -267,21 +278,5 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* (*widget_new)(GtkAdjustm return attr; } -void wxControl::ApplyWidgetStyle(bool forceStyle) -{ - GtkRcStyle *style = CreateWidgetStyle(forceStyle); - if ( style ) - { - DoApplyWidgetStyle(style); - gtk_rc_style_unref(style); - } -} - -void wxControl::DoApplyWidgetStyle(GtkRcStyle *style) -{ - gtk_widget_modify_style(m_widget, style); -} - - #endif // wxUSE_CONTROLS