• 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: Acquiring the visible characters from a NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Acquiring the visible characters from a NSTextView


  • Subject: Re: Acquiring the visible characters from a NSTextView
  • From: SA Dev <email@hidden>
  • Date: Wed, 22 Jun 2005 15:25:22 -0400


The one method that comes to mind is NSLayoutManager's - glyphRangeForBoundingRect:inTextContainer: method. You'll need to understand how a text view is constructed (it's in the docs) to figure out how to find the bounding rect based on what the textg view's enclosing scroll view is showing. You'll get back a range of glyphs.


There may be an easier/better way, but this was the first thing that popped into mind. Anybody?


On Jun 22, 2005, at 3:09 PM, Ian Archer wrote:

I want to get a copy of the characters that are visible (from
scrolling) within a NSTextView.   Going through
NSTextStorage->[NSMutableAttributedString mutableString] returns
everything.

Anyone know of a way to do this?

<ia>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Acquiring the visible characters from a NSTextView (From: Ian Archer <email@hidden>)

  • Prev by Date: How do I find my Application's directory?
  • Next by Date: Re: Acquiring the visible characters from a NSTextView
  • Previous by thread: Acquiring the visible characters from a NSTextView
  • Next by thread: Re: Acquiring the visible characters from a NSTextView
  • Index(es):
    • Date
    • Thread