Ascertaining the top line in a view
Ascertaining the top line in a view
- Subject: Ascertaining the top line in a view
- From: Vincent Coetzee <email@hidden>
- Date: Fri, 7 Nov 2003 09:11:23 +0200
Hi there
I have a requirement for drawing line numbers next to a text view.
Obviously the easiest way to do this in Cocoa is by means of a subclass
of NSRuler. How all this works I can figure out, what is confusing me
is how to ascertain the line number that is currently at the top of the
NSTextView. In the case of unformatted text, i.e. one line == one
paragraph, the number of paragraphs in the NSTextStorage is the number
of lines, but how does one ascertain the relative positions of
paragraphs with respect to the top of the NSTextView. I have spent
hours reading NSTextStorage, NSLayoutManager, NSTextContainer, NSText,
and NSTextView documentation without being able to figure this out. Has
anyone any more in-depth knowledge on this subject that perhaps
suggested a route ?
Thanks
Vincent
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.