Re: [NSTextView firstRectForCharacterRange:] returns empty rect
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