4
votes

I have an NSScrollView and items inside which I can re-arrange by drag & drop. And it auto-scrolls when I drag the items to the bottom & drop of the NSScrollView, but it only operates in a very small area. If my drag is not within about 4-6 pixels of the edge, auto-scroll does not happen. How do I increase this area?

2
plz add some code for such question ! you are more likely to get better suggestion for codes.Bishal Ghimire

2 Answers

0
votes

You could use NSTrackingArea which you can set in the NSScrollView (there are some example projects by Apple) or you could overwrite the - (void)mouseDragged:(NSEvent *)theEvent from NSResponder. If you use mouseDraggedyou probably need to keep attention to calculate with the right coordinates.

0
votes

I think the accepted answer here may be what you are looking for:

NSTableView in NSScrollView doesn't autoscroll when dragging