X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93763ad5ba900aecb9220a36ebe7447313ea3e31..539872aef30aedbf24339285374d19c0aedd2b11:/src/gtk/button.cpp?ds=sidebyside diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 74281019ca..35e0b4f537 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -13,6 +13,11 @@ #if wxUSE_BUTTON #include "wx/button.h" + +#ifndef WX_PRECOMP + #include "wx/toplevel.h" +#endif + #include "wx/stockitem.h" #include "wx/gtk/private.h" @@ -165,10 +170,10 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, void wxButton::SetDefault() { - wxWindow *parent = GetParent(); - wxCHECK_RET( parent, _T("button without parent?") ); + wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); + wxCHECK_RET( tlw, _T("button without top level window?") ); - parent->SetDefaultItem(this); + tlw->SetDefaultItem(this); GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT ); gtk_widget_grab_default( m_widget ); @@ -252,7 +257,7 @@ bool wxButton::Enable( bool enable ) return true; } -bool wxButton::IsOwnGtkWindow( GdkWindow *window ) +GdkWindow *wxButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const { return GTK_BUTTON(m_widget)->event_window; }