#include "wx/log.h"
#endif // WX_PRECOMP
+#include "wx/cocoa/ObjcPose.h"
+
#include "wx/cocoa/NSButton.h"
#import <AppKit/NSButton.h>
@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();
}
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:)];
+ }
}