[NSTextView] Scrolling to the top of the document via code
[NSTextView] Scrolling to the top of the document via code
- Subject: [NSTextView] Scrolling to the top of the document via code
- From: Stéphane Sudre <email@hidden>
- Date: Sat, 24 Nov 2007 02:50:51 +0100
What's the obvious API I'm missing to scroll to the real top of a
document displayed in a NSTextView?
I have a NSTextView with a TextContainer Inset set to (6.0f,6.0f).
When I replace the content of the NSTextView through its container
(usual beginEditing, readFromURL, ...) code, I end up with the document
not being displayed perfectly correctly. The document (if higher than
the view) is scrolled bit so that the first line of text is stuck to
the top of the scrollview instead of being 6 points away.
I tried to use the scrollPoint or scrollRangeVisibleSomething API with
different reasonable values, give a look at the GNUStep source code,
change the frame of the NSTextView and its clipview, etc. with no
success.
The document is still scrolled by default by a small amount (and it's
probably the TextContainer Inset height).
_______________________________________________
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