]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/button.cpp
test that the candidate parent window isn't being deleted (this would result in a...
[wxWidgets.git] / src / gtk1 / button.cpp
index c84debc53d2710540c53b85bac7255d1695dd252..6d71384052e2ba9125e6569788c95ec7ce375673 100644 (file)
 
 #if wxUSE_BUTTON
 
-#include "wx/button.h"
+#ifndef WX_PRECOMP
+    #include "wx/button.h"
+#endif
+
 #include "wx/stockitem.h"
 
 #include "wx/gtk1/private.h"
@@ -152,18 +155,17 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 }
 
 
-void wxButton::SetDefault()
+wxWindow *wxButton::SetDefault()
 {
-    wxWindow *parent = GetParent();
-    wxCHECK_RET( parent, _T("button without parent?") );
-
-    parent->SetDefaultItem(this);
+    wxWindow *oldDefault = wxButtonBase::SetDefault();
 
     GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
     gtk_widget_grab_default( m_widget );
 
     // resize for default border
     gtk_button_style_set_callback( m_widget, NULL, this );
+
+    return oldDefault;
 }
 
 /* static */