]> git.saurik.com Git - wxWidgets.git/commitdiff
implementing turning off of default button as well
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 6 Nov 2010 15:37:12 +0000 (15:37 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 6 Nov 2010 15:37:12 +0000 (15:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/button.mm

index d4560769bead2a149beddd589496f2610351bec4..77e2d206768b24b798c5b9a383ad2e7087d150a8 100644 (file)
@@ -188,10 +188,13 @@ wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
 
 void wxWidgetCocoaImpl::SetDefaultButton( bool isDefault )
 {
 
 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()
 }
 
 void wxWidgetCocoaImpl::PerformClick()