• 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 firstRectForCharacterRange:] returns empty rect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSTextView firstRectForCharacterRange:] returns empty rect


  • Subject: Re: [NSTextView firstRectForCharacterRange:] returns empty rect
  • From: Andy Lee <email@hidden>
  • Date: Mon, 6 Mar 2006 07:30:02 -0500

On Mar 6, 2006, at 6:43 AM, Tristan Leblanc wrote:
I have to frame some text items.

I think about using [NSTextView firstRectForCharacterRange:]

does anyone knows how this method works?

Actually, it just returns the location of selection rect.

Width and height are always 0, no matter the range i pass to this method...

Any guess or known bug?

I never heard of this method, but I just did a quick experiment and it seems to work as documented:


Returns the first frame rectangle for characters in theRange, in screen coordinates. If theRange spans multiple lines of text in the text view, the rectangle returned is the one for the characters in the first line. If the length of theRange is 0 (as it would be if there is nothing selected at the insertion point), the rectangle will coincide with the insertion point, and its width will be 0.

Can you post some code? How do you know the width and height are 0?

--Andy

_______________________________________________
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: 
 >[NSTextView firstRectForCharacterRange:] returns empty rect (From: Tristan Leblanc <email@hidden>)

  • Prev by Date: Re: Parsing a packet Async Socket
  • Next by Date: [Q] Many array elements observing a few UI elements
  • Previous by thread: [NSTextView firstRectForCharacterRange:] returns empty rect
  • Next by thread: Re: [NSTextView firstRectForCharacterRange:] returns empty rect
  • Index(es):
    • Date
    • Thread