• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Ascertaining the top line in a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Ascertaining the top line in a view
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Parameter lists
  • Next by Date: Re: Parameter lists
  • Previous by thread: Re: Parameter lists
  • Next by thread: Re: Ascertaining the top line in a view
  • Index(es):
    • Date
    • Thread