- m_needParent = TRUE;
-
- PreCreation( parent, id, pos, size, style, name );
-
- SetValidator( validator );
-
- SetLabel( label );
-
- m_widget = gtk_check_button_new_with_label( m_label );
-
- wxSize newSize = size;
- if (newSize.x == -1) newSize.x = 25+gdk_string_measure( m_widget->style->font, label );
- if (newSize.y == -1) newSize.y = 26;
- SetSize( newSize.x, newSize.y );
-
- gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
- GTK_SIGNAL_FUNC(gtk_checkbox_clicked_callback), (gpointer*)this );
-
- PostCreation();
-
- Show( TRUE );
-
- return TRUE;
+ m_needParent = TRUE;
+ m_acceptsFocus = TRUE;
+
+ PreCreation( parent, id, pos, size, style, name );
+
+ SetValidator( validator );
+
+ m_widget = gtk_check_button_new_with_label( m_label );
+
+ m_blockFirstEvent = FALSE;
+
+ wxSize newSize = size;
+ if (newSize.x == -1) newSize.x = 25+gdk_string_measure( m_widget->style->font, label );
+ if (newSize.y == -1) newSize.y = 26;
+ SetSize( newSize.x, newSize.y );
+
+ 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 );
+
+ SetLabel( label );
+
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
+ SetFont( parent->GetFont() );
+
+ Show( TRUE );
+
+ return TRUE;