How do I disable the autoscroll in a NSScrollView as I’m filling it with content?
I have subclassed it in my own class but I don’t find an appropriate method to override.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s probably more than one way to go about this, but take a look at
-[NSClipView constrainScrollPoint:]. It’s not meant to be called directly, rather to be overridden in anNSClipViewsubclass.NSClipViewis the class that actually does the real work of scrolling the content of anNSScrollView.You should be able to override it to simply return the document view’s current origin point when you don’t want scrolling to happen. It’s worth noting that this will also disable scrolling via the user-visible interface, so you should only do it while you’re filling the view with content. Otherwise, return the result of a call to the superclass’s implementation.