Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have an NSView which is registered for a drag operation.

In that view I have a subclassed NSScrollView, which in itself has an NSImageView in it.

When dragging onto the original NSView, everything is fine, other than when I drag over the aforementioned NSImageView, which seems to interupt the drag and I cannot drop onto it (or in fact, the view underneath it.

The NSScrollView appears to ignore the drag and allows that to go through to the underlying NSView, but how can I do that for the NSImageView so that the Drag/Drop registers through itself, it's superview (the NSScrollView) and onto the underlying NSView.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
690 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can unregister the NSImageView as a dragging destination. Its superview will then handle the dragging session, if it's set up to do that.

[imageView unregisterDraggedTypes];

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...