+ wxCHECK_RET( m_widgetCheckbox != NULL, wxT("invalid checkbox") );
+
+ if (state == GetValue())
+ return;
+
+ m_blockEvent = TRUE;
+
+ gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widgetCheckbox), state );
+
+ m_blockEvent = FALSE;
+}
+
+bool wxCheckBox::GetValue() const
+{
+ wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, wxT("invalid checkbox") );
+
+#ifdef __WXGTK20__
+ return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_widgetCheckbox));
+#else
+ return GTK_TOGGLE_BUTTON(m_widgetCheckbox)->active;
+#endif
+}
+
+#ifdef __WXGTK20__
+void wxCheckBox::DoSet3StateValue(wxCheckBoxState state)
+{
+ SetValue(state != wxCHK_UNCHECKED);
+ gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(m_widgetCheckbox),
+ state == wxCHK_UNDETERMINED);
+}
+
+wxCheckBoxState wxCheckBox::DoGet3StateValue() const
+{
+ if (gtk_toggle_button_get_inconsistent(GTK_TOGGLE_BUTTON(m_widgetCheckbox)))
+ {
+ return wxCHK_UNDETERMINED;
+ }
+ else
+ {
+ return GetValue() ? wxCHK_CHECKED : wxCHK_UNCHECKED;
+ }
+}
+#endif
+
+void wxCheckBox::SetLabel( const wxString& label )
+{
+ wxCHECK_RET( m_widgetLabel != NULL, wxT("invalid checkbox") );
+
+ wxControl::SetLabel( label );
+
+#ifdef __WXGTK20__
+ wxString label2 = PrepareLabelMnemonics( label );
+ gtk_label_set_text_with_mnemonic( GTK_LABEL(m_widgetLabel), wxGTK_CONV( label2 ) );
+#else
+ gtk_label_set( GTK_LABEL(m_widgetLabel), wxGTK_CONV( GetLabel() ) );
+#endif
+}
+
+bool wxCheckBox::Enable( bool enable )
+{
+ if ( !wxControl::Enable( enable ) )
+ return FALSE;
+
+ gtk_widget_set_sensitive( m_widgetLabel, enable );
+
+ return TRUE;
+}
+
+void wxCheckBox::DoApplyWidgetStyle(GtkRcStyle *style)
+{
+ gtk_widget_modify_style(m_widgetCheckbox, style);
+ gtk_widget_modify_style(m_widgetLabel, style);
+}
+
+bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window )
+{
+ return window == TOGGLE_BUTTON_EVENT_WIN(m_widget);