• 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: location of text in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: location of text in NSTextView


  • Subject: Re: location of text in NSTextView
  • From: Nik Youdale <email@hidden>
  • Date: Tue, 24 Jan 2006 07:53:49 +1100

Thanks guys,

I got it all working. For future reference, the code I used is:

range = [[textView layoutManager] glyphRangeForCharacterRange:someRange actualCharacterRange:nil];
rect = [[textView layoutManager] boundingRectForGlyphRange:range inTextContainer:[textView textContainer]];
rect2 = [self convertRect:rect fromView:textView];
return rect2;


- Nik


On 24/01/2006, at 4:38 AM, Douglas Davidson wrote:


On Jan 21, 2006, at 7:02 PM, Nik Youdale wrote:

Yes, you are right, but i've given up on that now. Im trying a different approach with a single textView, but somehow i need the location of text within a specified range. I've tried using the layoutManager's - (NSRect)boundingRectForGlyphRange:(NSRange) glyphRange inTextContainer:(NSTextContainer *)aTextContainer method, as i thought that would do exactly what i wanted, but either I'm giving it the wrong parameters, or it doesn't actually do what i am wanting.


Take a look at the LayoutManagerDemo sample code at developer.apple.com.


Douglas Davidson


_______________________________________________ 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
  • Follow-Ups:
    • Re: location of text in NSTextView
      • From: Douglas Davidson <email@hidden>
References: 
 >location of text in NSTextView (From: Nik Youdale <email@hidden>)
 >Re: location of text in NSTextView (From: Eamon Ford <email@hidden>)
 >Re: location of text in NSTextView (From: Nik Youdale <email@hidden>)
 >Re: location of text in NSTextView (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Can bindings be set to ignore certain values?
  • Next by Date: Re: location of text in NSTextView
  • Previous by thread: Re: location of text in NSTextView
  • Next by thread: Re: location of text in NSTextView
  • Index(es):
    • Date
    • Thread