]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/checkbox.cpp
preserve checkbox status in SetString()
[wxWidgets.git] / src / gtk / checkbox.cpp
index 6c21e580a27d6a4dfd9575b0e2fcd108b857c927..8c1c45257a0a66993bcbf9f24dd171e1eeed9d44 100644 (file)
@@ -78,7 +78,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
         }
     }
 
-    wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId());
+    wxCommandEvent event(wxEVT_CHECKBOX, cb->GetId());
     event.SetInt(cb->Get3StateValue());
     event.SetEventObject(cb);
     cb->HandleWindowEvent(event);
@@ -91,6 +91,13 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
 
 wxCheckBox::wxCheckBox()
 {
+    m_widgetCheckbox = NULL;
+}
+
+wxCheckBox::~wxCheckBox()
+{
+    if (m_widgetCheckbox && m_widgetCheckbox != m_widget)
+        GTKDisconnect(m_widgetCheckbox);
 }
 
 bool wxCheckBox::Create(wxWindow *parent,