X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58614078c466cffaf0e5d0369741706f130fb793..ef44a62179cde47dffb369b9731b2f74d54de52f:/src/gtk1/button.cpp diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 249465f366..8338f5bcff 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -45,14 +45,20 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton * IMPLEMENT_DYNAMIC_CLASS(wxButton,wxControl) -wxButton::wxButton(void) +wxButton::wxButton() { } +wxButton::~wxButton() +{ + if (m_clientData) delete m_clientData; +} + bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos, const wxSize &size, long style, const wxValidator& validator, const wxString &name ) { + m_clientData = (wxClientData*) NULL; m_needParent = TRUE; wxSize newSize = size; @@ -71,6 +77,10 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this ); + m_parent->AddChild( this ); + + (m_parent->m_insertCallback)( m_parent, this ); + PostCreation(); SetBackgroundColour( parent->GetBackgroundColour() ); @@ -114,3 +124,4 @@ void wxButton::ApplyWidgetStyle() gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle ); } +