X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93763ad5ba900aecb9220a36ebe7447313ea3e31..eff112a64082e20a581fb489980b76e1d7bb0d5e:/src/gtk1/button.cpp diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index c84debc53d..6d71384052 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -12,7 +12,10 @@ #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 */