]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/checkbox.cpp
fix bug with univ creating textctrl
[wxWidgets.git] / src / gtk1 / checkbox.cpp
index 2a7d0437bf6b44c4c240e42a8f7ca642c2b22e0f..33f8a565b79d5cebb1fbaf3aa15dde039be7f09f 100644 (file)
@@ -120,19 +120,7 @@ bool wxCheckBox::Create(wxWindow *parent,
 
     m_parent->DoAddChild( this );
 
 
     m_parent->DoAddChild( this );
 
-    PostCreation();
-    InheritAttributes();
-
-    wxSize size_best( DoGetBestSize() );
-    wxSize new_size( size );
-    if (new_size.x == -1)
-        new_size.x = size_best.x;
-    if (new_size.y == -1)
-        new_size.y = size_best.y;
-    if ((new_size.x != size.x) || (new_size.y != size.y))
-        SetSize( new_size.x, new_size.y );
-
-    Show( TRUE );
+    PostCreation(size);
 
     return TRUE;
 }
 
     return TRUE;
 }
@@ -170,6 +158,8 @@ void wxCheckBox::SetLabel( const wxString& label )
 #else
     gtk_label_set( GTK_LABEL(m_widgetLabel), wxGTK_CONV( GetLabel() ) );
 #endif
 #else
     gtk_label_set( GTK_LABEL(m_widgetLabel), wxGTK_CONV( GetLabel() ) );
 #endif
+
+    PostSetLabel();
 }
 
 bool wxCheckBox::Enable( bool enable )
 }
 
 bool wxCheckBox::Enable( bool enable )
@@ -182,11 +172,10 @@ bool wxCheckBox::Enable( bool enable )
     return TRUE;
 }
 
     return TRUE;
 }
 
-void wxCheckBox::ApplyWidgetStyle()
+void wxCheckBox::DoApplyWidgetStyle(GtkRcStyle *style)
 {
 {
-    SetWidgetStyle();
-    gtk_widget_set_style( m_widgetCheckbox, m_widgetStyle );
-    gtk_widget_set_style( m_widgetLabel, m_widgetStyle );
+    gtk_widget_modify_style(m_widgetCheckbox, style);
+    gtk_widget_modify_style(m_widgetLabel, style);
 }
 
 bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window )
 }
 
 bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window )
@@ -228,4 +217,11 @@ wxSize wxCheckBox::DoGetBestSize() const
     return wxControl::DoGetBestSize();
 }
 
     return wxControl::DoGetBestSize();
 }
 
+// static
+wxVisualAttributes
+wxCheckBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+    return GetDefaultAttributesFromGTKWidget(gtk_check_button_new);
+}
+
 #endif
 #endif