X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f96aa4d9eb296b3dfc468a351ce013bf92fab983..ef5390661e7e0122ecaab8eeafd9a221fed3f80b:/src/gtk1/checkbox.cpp diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index b33fd486e6..c125d9d2df 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -2,7 +2,7 @@ // Name: checkbox.cpp // Purpose: // Author: Robert Roebling -// Id: $id$ +// Id: $Id$ // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -65,6 +65,10 @@ bool wxCheckBox::Create( wxWindow *parent, wxWindowID id, const wxString &label gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", GTK_SIGNAL_FUNC(gtk_checkbox_clicked_callback), (gpointer*)this ); + m_parent->AddChild( this ); + + (m_parent->m_insertCallback)( m_parent, this ); + PostCreation(); gtk_widget_realize( GTK_BUTTON( m_widget )->child ); @@ -72,6 +76,7 @@ bool wxCheckBox::Create( wxWindow *parent, wxWindowID id, const wxString &label SetLabel( label ); SetBackgroundColour( parent->GetBackgroundColour() ); + SetForegroundColour( parent->GetForegroundColour() ); Show( TRUE ); @@ -113,29 +118,11 @@ void wxCheckBox::Enable( bool enable ) gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable ); } -void wxCheckBox::SetFont( const wxFont &font ) +void wxCheckBox::ApplyWidgetStyle() { - wxCHECK_RET( m_widget != NULL, "invalid checkbox" ); - - wxControl::SetFont( font ); - - gtk_widget_set_style( GTK_BUTTON(m_widget)->child, - gtk_style_ref( - gtk_widget_get_style( m_widget ) ) ); + SetWidgetStyle(); + gtk_widget_set_style( m_widget, m_widgetStyle ); + gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle ); } -void wxCheckBox::SetBackgroundColour( const wxColour &colour ) -{ - return; - - wxCHECK_RET( m_widget != NULL, "invalid checkbox" ); - - wxControl::SetBackgroundColour( colour ); - - if (!m_backgroundColour.Ok()) return; - - gtk_widget_set_style( GTK_BUTTON(m_widget)->child, - gtk_style_ref( - gtk_widget_get_style( m_widget ) ) ); -}