From: Stefan Csomor Date: Sat, 6 Nov 2010 15:37:12 +0000 (+0000) Subject: implementing turning off of default button as well X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3f30bd1a8de0003b8963ee269eef9b361249828a implementing turning off of default button as well git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index d4560769be..77e2d20676 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -188,10 +188,13 @@ wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer, void wxWidgetCocoaImpl::SetDefaultButton( bool isDefault ) { - if ( isDefault && [m_osxView isKindOfClass:[NSButton class]] ) - // NOTE: setKeyEquivalent: nil will trigger an assert - // instead do not call in that case. - [(NSButton*)m_osxView setKeyEquivalent: @"\r" ]; + if ( [m_osxView isKindOfClass:[NSButton class]] ) + { + if ( isDefault ) + [(NSButton*)m_osxView setKeyEquivalent: @"\r" ]; + else + [(NSButton*)m_osxView setKeyEquivalent: @"" ]; + } } void wxWidgetCocoaImpl::PerformClick()