It has been some time since I did any Cocoa development, and I'm trying to make this very fast and dirty (and simple) application wrapped up. I decided to use MacRuby because it was a good excuse to learn it, and the application is simple enough to make sense.
I'm having trouble getting a custom view to respond to drag and drop events.
class ImportPanel < Panel def initWithFrame(frame) registerForDraggedTypes(NSArray.arrayWithObjects(NSPasteboardTypeSound, nil)) super(frame) end def mouseDown(event) NSLog('click') end def draggingEntered(sender) NSLog('drag') end end
The panel, in this case, is simply an NSView that adds a border. This custom view (ImportPanel) responds correctly to click events, but does not respond to event drag and drop. I tried several different types of cardboard and configurations for registerForDraggedTypes: but none of them give any results.
source share