X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ed97552373524bb54b71cd967b2df135e81ee51..11fe6505b848a968f4c89cb3c3fd37a6a03bcaea:/src/cocoa/radiobox.mm?ds=inline diff --git a/src/cocoa/radiobox.mm b/src/cocoa/radiobox.mm index c67639ccf1..0d71ecdfad 100644 --- a/src/cocoa/radiobox.mm +++ b/src/cocoa/radiobox.mm @@ -24,6 +24,7 @@ #include "wx/cocoa/string.h" #include "wx/cocoa/autorelease.h" +#import #include "wx/cocoa/objc/NSView.h" #import #import @@ -32,7 +33,23 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) BEGIN_EVENT_TABLE(wxRadioBox, wxControl) END_EVENT_TABLE() -// WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView) + +void wxRadioBox::AssociateNSBox(WX_NSBox cocoaObjcClass) +{ + NSMatrix *radioBox = [(WX_NSBox)cocoaObjcClass contentView]; + // Associate the NSMatrix (the NSBox's contentView) with the wxCocoaNSControl MI base class. + AssociateNSControl(radioBox); + // Set the target/action.. we don't really need to unset these + [radioBox setTarget:wxCocoaNSControl::sm_cocoaTarget]; + [radioBox setAction:@selector(wxNSControlAction:)]; +} + +void wxRadioBox::DisassociateNSBox(WX_NSBox cocoaObjcClass) +{ + DisassociateNSControl([(WX_NSBox)cocoaObjcClass contentView]); +} + +WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSBox,NSView,NSView) bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid, const wxString& title, @@ -79,7 +96,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid, NSMutableArray *allCells = [NSMutableArray arrayWithCapacity:n]; for(int i=0; i