• 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: Forcing a scroll to the top of an NSScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing a scroll to the top of an NSScrollView


  • Subject: Re: Forcing a scroll to the top of an NSScrollView
  • From: Adam Holt <email@hidden>
  • Date: Fri, 05 Aug 2005 12:54:09 +0100

Many thanks Pontus and also to David Hoerl who sent me some suggestions
privately.  This works now.

For the record, I had to add an extra line to this as I had forgotten about
NSZeroPoint being the bottom left corner rather than the top (where I wanted
my Scroll bar to go).

So my final solution is:

        NSPoint pt = NSMakePoint(0.0, [[myScrollView documentView]
bounds].size.height);
        [[myScrollView documentView] scrollPoint:pt];

Cheers, adam.

On 5/8/05 10:25 am, "Pontus Ilbring" <email@hidden> wrote:

> On 8/4/05, Adam Holt <email@hidden> wrote:
>> Hi,
>>
>> I'm trying to force my scrollview to scroll to the top.  I've tried a few
>> things but neither have worked, including:
>>
>>         [myScrollView scrollPoint:NSZeroPoint];
>
> scrollPoint: scrolls the receiver's ancestor clip view and not the
> receiver itself, which is why sending scrollPoint: to the scroll view
> does nothing. You have to send the message to the scroll view's
> contents:
>
> [[myScrollView documentView] scrollPoint:NSZeroPoint];


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Forcing a scroll to the top of an NSScrollView (From: Pontus Ilbring <email@hidden>)

  • Prev by Date: Re: Forcing a scroll to the top of an NSScrollView
  • Next by Date: Re: Cocoa Books?
  • Previous by thread: Re: Forcing a scroll to the top of an NSScrollView
  • Next by thread: Computer Type
  • Index(es):
    • Date
    • Thread