X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/461a37f596c27c84af5868c6072c07eb344c536c..422644a3173c7309f1b67f138ed6cdfeaa24ddf1:/src/mac/carbon/button.cpp diff --git a/src/mac/carbon/button.cpp b/src/mac/carbon/button.cpp index 03ce6f1b29..072ba01720 100644 --- a/src/mac/carbon/button.cpp +++ b/src/mac/carbon/button.cpp @@ -37,7 +37,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1, + m_macControl = ::NewControl( parent->MacGetRootWindow() , &bounds , title , false , 0 , 0 , 1, kControlPushButtonProc , (long) this ) ; wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ; @@ -50,12 +50,11 @@ void wxButton::SetDefault() { wxWindow *parent = GetParent(); wxButton *btnOldDefault = NULL; - wxPanel *panel = wxDynamicCast(parent, wxPanel); - if ( panel ) + if ( parent ) { - btnOldDefault = wxDynamicCast(panel->GetDefaultItem(), + btnOldDefault = wxDynamicCast(parent->GetDefaultItem(), wxButton); - panel->SetDefaultItem(this); + parent->SetDefaultItem(this); } Boolean inData;