diff --git a/include/wx/gtk/scrolbar.h b/include/wx/gtk/scrolbar.h index f471873aa3..672334a1de 100644 --- a/include/wx/gtk/scrolbar.h +++ b/include/wx/gtk/scrolbar.h @@ -77,6 +77,9 @@ public: GtkAdjustment *m_adjust; float m_oldPos; +protected: + virtual wxSize DoGetBestSize() const; + private: DECLARE_DYNAMIC_CLASS(wxScrollBar) }; diff --git a/include/wx/gtk1/scrolbar.h b/include/wx/gtk1/scrolbar.h index f471873aa3..672334a1de 100644 --- a/include/wx/gtk1/scrolbar.h +++ b/include/wx/gtk1/scrolbar.h @@ -77,6 +77,9 @@ public: GtkAdjustment *m_adjust; float m_oldPos; +protected: + virtual wxSize DoGetBestSize() const; + private: DECLARE_DYNAMIC_CLASS(wxScrollBar) }; diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index 14530aef24..42fa93452d 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -180,6 +180,8 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, PostCreation(); + SetBestSize(size); + SetBackgroundColour( parent->GetBackgroundColour() ); Show( TRUE ); @@ -334,4 +336,9 @@ void wxScrollBar::ApplyWidgetStyle() gtk_widget_set_style( m_widget, m_widgetStyle ); } +wxSize wxScrollBar::DoGetBestSize() const +{ + return wxControl::DoGetBestSize(); +} + #endif diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index 14530aef24..42fa93452d 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/scrolbar.cpp @@ -180,6 +180,8 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, PostCreation(); + SetBestSize(size); + SetBackgroundColour( parent->GetBackgroundColour() ); Show( TRUE ); @@ -334,4 +336,9 @@ void wxScrollBar::ApplyWidgetStyle() gtk_widget_set_style( m_widget, m_widgetStyle ); } +wxSize wxScrollBar::DoGetBestSize() const +{ + return wxControl::DoGetBestSize(); +} + #endif