]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/button.mm
fix wxGTK1 compilation after wxTextEntry DoGetValue() change
[wxWidgets.git] / src / osx / cocoa / button.mm
index 7df36925de73d3967c6b5c0dcddeac82068391ac..fb57055cd552dc862758d91210bab2ae2c436af8 100644 (file)
@@ -242,8 +242,10 @@ wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
 
 void wxWidgetCocoaImpl::SetDefaultButton( bool isDefault )
 { 
-    if ( [m_osxView isKindOfClass:[NSButton class]] )
-        [(NSButton*)m_osxView setKeyEquivalent: isDefault ? @"\r" : nil ];
+    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" ];
 }
 
 void wxWidgetCocoaImpl::PerformClick()