Problem with smooth scrolling in Cocoa
Problem with smooth scrolling in Cocoa
- Subject: Problem with smooth scrolling in Cocoa
- From: Aleksandr Skobelev <email@hidden>
- Date: Mon, 23 Oct 2006 15:44:14 +0400
Hello!
Could anybody comment on the following problem, please?
I need to implement some custom behavior in NSTextView scrolling, in
particular I need to highlight some word and update correspondent
information in other controls. For this I've inherited from
NSTextView and overridden the methods like moveDown:, moveUp:,
scrollPageDown:, scrollPageUp:.
The scrollPageUp: method now looks like this:
- (void) scrollPageUp: (id) sender
{
[super scrollPageUp: sender];
[self afterScrollPage];
}
In the afterScrollPage method, with help of -[NSView visibleRect] I
determine the visible characters rectangle and check if the currently
selected word lies in that rectangle. But all this code works fine
only when Use Smooth Scrolling is not selected in the Appearance
panel of System Preferences. If it is selected then in the point of
call of the afterScrollPage method above the -[NSView visibleRect]
method return the incorrect rectangle: not as it's became after
scrolling, but as it was before.
Is it a bug or maybe I just do something wrong? Maybe there is some
sort of notification that can help to reliably catch the moment when
the scrolling has finished, so that -[NSView visibleRect] will return
the proper value?
Thanks in advance,
Aleksandr Skobelev
_______________________________________________
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