• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Avoid smooth scrolling when scrolling programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoid smooth scrolling when scrolling programmatically


  • Subject: Avoid smooth scrolling when scrolling programmatically
  • From: email@hidden (Stefan Haller)
  • Date: Mon, 12 Sep 2011 09:07:13 +0200

I need to set the scroll position of my NSScrollView programmatically,
and I don't want it to scroll smoothly (if the user's "smooth scrolling"
preference is on).  I can't find a way how to do that.

Calling scrollPoint: on my document view results in smooth scrolling. I
thought that removing the scroll view from its superview before and
adding it back afterwards would prevent this, but it doesn't.

I also tried calling setBoundsOrigin: on the content view instead, but
it also results in an animation (although only sometimes, and in
different cases than with scrollPoint; I haven't been able to figure out
the details yet).

I guess I could mess with NSUserDefaults, turning off smooth scrolling
before calling scrollPoint and restoring it to what it was before
afterwards, but this seems like a hack to me.

Any other ideas?


--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Avoid smooth scrolling when scrolling programmatically
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: [Solved] Re: Accessing a Javascript datasource object via Cocoa
  • Next by Date: how to get baseline info
  • Previous by thread: Internal warning/failure appears not to be my code after all.
  • Next by thread: Re: Avoid smooth scrolling when scrolling programmatically
  • Index(es):
    • Date
    • Thread