]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/NSButton.mm
really show the window after creation (calling Show(TRUE) doesn't do it any more)
[wxWidgets.git] / src / cocoa / NSButton.mm
index c228460dd41cfc59d51363bfa39d7536105574a6..63cf30df2f37dff30e62d253ce07080f0c0b3427 100644 (file)
@@ -47,9 +47,9 @@ 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,wxT("Received wxNSButtonAction from another object"));
     wxCocoaNSButton *button = wxCocoaNSButton::GetFromCocoa(self);
-    wxCHECK_RET(button,"wxNSButtonAction received without associated wx object");
+    wxCHECK_RET(button,wxT("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:)];
+    }
 }