• 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
Re: Getting called back when an NSScrollView is scrolled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting called back when an NSScrollView is scrolled


  • Subject: Re: Getting called back when an NSScrollView is scrolled
  • From: John Stiles <email@hidden>
  • Date: Mon, 28 Jan 2008 09:53:10 -0800

Well, one goal is to get two scroll views to scroll in tandem—when the user scrolls Scroll View A, another Scroll View B should match its scroll. (They are next to one another so it looks like one big view to the user.)

Moreover, though, this is for shared code which a bunch of things are going to use, so it's entirely possible that it will be used for other goals which I won't be able to predict as well. I don't think it's an unreasonable thing to want to know when a user has scrolled a view. I am actually pretty surprised that there aren't delegate methods on the NSScrollView already to handle this sort of thing.

I experimented with reflectScrolledClipView after posting this and it looks like it gets called a lot. I think for my particular case it might end up causing an infinite loop:

- View A gets reflectScrolledClipView
- … so we scroll View B to match
- In response, View B  gets reflectScrolledClipView
- … so we scroll View A to match
- This occurs ad infinitum, overflowing the stack
- Crash

Didn't actually get this far to verify the result but that's what it looks like so far.


Kyle Sluder wrote:
On Jan 28, 2008 12:33 PM, John Stiles <email@hidden> wrote:
I'd like to get a message sent to my app whenever the user scrolls a
particular NSScrollView around.

What is it exactly that you're trying to do? Perhaps there's a way to accomplish your goal without co-opting the behavior of the scrollers. I've found it's always useful to describe my end result, even if I'm 99% sure there's only one way to achieve it.

--Kyle Sluder
_______________________________________________

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: Getting called back when an NSScrollView is scrolled
      • From: j o a r <email@hidden>
References: 
 >Running process as root from Cocoa (From: "Mitchell Hashimoto" <email@hidden>)
 >Re: Running process as root from Cocoa (From: "Hamish Allan" <email@hidden>)
 >Getting called back when an NSScrollView is scrolled (From: John Stiles <email@hidden>)
 >Re: Getting called back when an NSScrollView is scrolled (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: The mouse is where, again?
  • Next by Date: Re: Getting the current text container or text view from a layout manager
  • Previous by thread: Re: Getting called back when an NSScrollView is scrolled
  • Next by thread: Re: Getting called back when an NSScrollView is scrolled
  • Index(es):
    • Date
    • Thread