FROM : Bill Bumgarner
DATE : Mon Dec 31 18:50:12 2007
On Dec 31, 2007, at 7:28 AM, Allen Dang wrote:
> NSPoint newPosition = NSMakePoint(0.0, 100.0);
> [[scrollView documentView] scrollPoint:newPosition];
>
> Ok, the scrollView did scroll to the new position, then I tried to
> continuously scroll down by using the mouse wheel, but the
> NSScrollView didn't work as I expected.
> It will return to the the point(0.0, 0.0) at first and start to
> scroll down rather then keep scrolling from point(0.0, 100.0).
If the scroll view contains a text view, then use NSText's -
(void)scrollRangeToVisible:(NSRange)range; method.
For NSView, try -scrollRectToVisible: instead. It is sort of the
focal point for all scrolling operations in NSView.
However, if the behavior persists then -- obviously -- something else
is going on. Are you setting the scrolling position from a thread,
perchance? That could cause confusion.
b.bum
DATE : Mon Dec 31 18:50:12 2007
On Dec 31, 2007, at 7:28 AM, Allen Dang wrote:
> NSPoint newPosition = NSMakePoint(0.0, 100.0);
> [[scrollView documentView] scrollPoint:newPosition];
>
> Ok, the scrollView did scroll to the new position, then I tried to
> continuously scroll down by using the mouse wheel, but the
> NSScrollView didn't work as I expected.
> It will return to the the point(0.0, 0.0) at first and start to
> scroll down rather then keep scrolling from point(0.0, 100.0).
If the scroll view contains a text view, then use NSText's -
(void)scrollRangeToVisible:(NSRange)range; method.
For NSView, try -scrollRectToVisible: instead. It is sort of the
focal point for all scrolling operations in NSView.
However, if the behavior persists then -- obviously -- something else
is going on. Are you setting the scrolling position from a thread,
perchance? That could cause confusion.
b.bum
| Related mails | Author | Date |
|---|---|---|
| Allen Dang | Dec 31, 16:28 | |
| Bill Bumgarner | Dec 31, 18:50 | |
| Allen Dang | Jan 1, 03:51 |






Cocoa mail archive

