• 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
Re: NSTextView and Line Numbering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView and Line Numbering


  • Subject: Re: NSTextView and Line Numbering
  • From: Jérôme Laurens <email@hidden>
  • Date: Thu, 20 Feb 2003 11:23:01 +0100

Le jeudi, 20 fiv 2003, ` 01:53 Europe/Zurich, James Derry a icrit :

> Hi again all,
>
> Here I am once again soliciting some help. Specifically I'm trying to
> implement a scheme whereby I can override NSTextView (or something) to
> display line numbers along side the NSTextView contents. Problem is,
> there
> aren't not a whole lot of comments out there (well, here and Google
> groups)
> and I'm getting all lost.
>


Once the layout is complete, use the layout manager of the text view
- (NSRect)lineFragmentRectForGlyphAtIndex:(unsigned)glyphIndex
effectiveRange:(NSRangePointer)lineFragmentRange
You can scan the whole text to create an array of rects for each line:
You'll have your dimens,
all the rest is details.
_______________________________________________
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.

References: 
 >NSTextView and Line Numbering (From: James Derry <email@hidden>)

  • Prev by Date: Re: Squared Ends in Textured Window
  • Next by Date: Re: Application Security...
  • Previous by thread: NSTextView and Line Numbering
  • Next by thread: Re: NSTextView and Line Numbering
  • Index(es):
    • Date
    • Thread