]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/NSButton.mm
Fixed Mac CodeWarrior compilation (there's no <sys/types.h>).
[wxWidgets.git] / src / cocoa / NSButton.mm
index c228460dd41cfc59d51363bfa39d7536105574a6..1728984c531d63eac5fedcf4c74a8245d959111c 100644 (file)
@@ -47,7 +47,7 @@ WX_IMPLEMENT_POSER(wxPoserNSButton);
 @implementation wxPoserNSButton :  NSButton
 - (void)wxNSButtonAction: (id)sender
 {
-    wxASSERT_MSG(self==sender,"Received wxNSButtonAction from another object");
+    wxASSERT_MSG((id)self==sender,"Received wxNSButtonAction from another object");
     wxCocoaNSButton *button = wxCocoaNSButton::GetFromCocoa(self);
     wxCHECK_RET(button,"wxNSButtonAction received without associated wx object");
     button->Cocoa_wxNSButtonAction();
@@ -57,8 +57,11 @@ WX_IMPLEMENT_POSER(wxPoserNSButton);
 
 void wxCocoaNSButton::AssociateNSButton(WX_NSButton cocoaNSButton)
 {
-    sm_cocoaHash.insert(wxCocoaNSButtonHash::value_type(cocoaNSButton,this));
-    [cocoaNSButton setTarget: cocoaNSButton];
-    [cocoaNSButton setAction: @selector(wxNSButtonAction:)];
+    if(cocoaNSButton)
+    {
+        sm_cocoaHash.insert(wxCocoaNSButtonHash::value_type(cocoaNSButton,this));
+        [cocoaNSButton setTarget: cocoaNSButton];
+        [cocoaNSButton setAction: @selector(wxNSButtonAction:)];
+    }
 }