- if (state)
- gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_ACTIVE );
- else
- gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), GTK_STATE_NORMAL );
-};
+ wxCHECK_RET( m_widget != NULL, "invalid checkbox" );
+
+ if ( state == GetValue() )
+ return;
+
+ // for compatibility with wxMSW don't send notification when the check box
+ // state is changed programmatically
+ m_blockFirstEvent = TRUE;
+
+ gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), state );
+}
+
+bool wxCheckBox::GetValue() const
+{
+ wxCHECK_MSG( m_widget != NULL, FALSE, "invalid checkbox" );
+
+ return GTK_TOGGLE_BUTTON(m_widget)->active;
+}
+
+void wxCheckBox::SetLabel( const wxString& label )
+{
+ wxCHECK_RET( m_widget != NULL, "invalid checkbox" );