+void wxWidgetCocoaImpl::SetDropTarget(wxDropTarget* target)
+{
+ [m_osxView unregisterDraggedTypes];
+
+ if ( target == NULL )
+ return;
+
+ wxDataObject* dobj = target->GetDataObject();
+
+ if( dobj )
+ {
+ CFMutableArrayRef typesarray = CFArrayCreateMutable(kCFAllocatorDefault,0,&kCFTypeArrayCallBacks);
+ dobj->AddSupportedTypes(typesarray);
+ NSView* targetView = m_osxView;
+ if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
+ targetView = [(NSScrollView*) m_osxView documentView];
+
+ [targetView registerForDraggedTypes:(NSArray*)typesarray];
+ CFRelease(typesarray);
+ }
+}