I have a NSTextView with a sizeable quantity of text. Whenever I scroll however, the view isn't updated properly. There are some artifacts that remain at the top or the bottom of the view. It appears that the view doesn't refresh itself often enough. If I scroll very slowly the view updates correctly though. If I add a border to the view everything works perfectly, borderless view is the one that has a problem. Here's a link to a screenshot:
Thanks
Have you set the setDrawsBackground
and copiesOnScroll
propertes for either the NSScrollView
or the NSClipView
?
The first thing I would suggest is turning off the "draws background" property of the NSScrollView
:
[myScrollView setDrawsBackground:NO];
Note that this should be set on the NSScrollView
, and not on the embedded NSClipView
.
The following excerpt from the documentation may be relevant:
If your
NSScrollView
encloses anNSClipView
sending asetDrawsBackground:
message with a parameter ofNO
to theNSScrollView
has the added effect of sending theNSClipView
asetCopiesOnScroll:
message with a parameter ofNO
. The side effect of sending thesetDrawsBackground:
message directly to theNSClipView
instead would be the appearance of “trails” (vestiges of previous drawing) in the document view as it is scrolled.