From 97149f189837c4a5e3220e9d979386ae3a264881 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 17 Apr 2004 02:07:31 +0000 Subject: [PATCH] SetDefault should call parent->SetDefaultItem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26840 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/button.cpp | 5 +++++ src/gtk1/button.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 86b455462f..177356a071 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -154,6 +154,11 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, void wxButton::SetDefault() { + wxWindow *parent = GetParent(); + wxCHECK_RET( parent, _T("button without parent?") ); + + wxWindow *winOldDefault = parent->SetDefaultItem(this); + GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT ); gtk_widget_grab_default( m_widget ); diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 86b455462f..177356a071 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -154,6 +154,11 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, void wxButton::SetDefault() { + wxWindow *parent = GetParent(); + wxCHECK_RET( parent, _T("button without parent?") ); + + wxWindow *winOldDefault = parent->SetDefaultItem(this); + GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT ); gtk_widget_grab_default( m_widget );