X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb896a322a2ed53d393ee738765ddd3f72cee004..2b1ff57f1ee08eb970520de784816c4115bd84f0:/src/cocoa/NSButton.mm diff --git a/src/cocoa/NSButton.mm b/src/cocoa/NSButton.mm index 11027892aa..63cf30df2f 100644 --- a/src/cocoa/NSButton.mm +++ b/src/cocoa/NSButton.mm @@ -22,6 +22,8 @@ #include "wx/log.h" #endif // WX_PRECOMP +#include "wx/cocoa/ObjcPose.h" + #include "wx/cocoa/NSButton.h" #import @@ -45,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(); } @@ -55,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:)]; + } }