Re: setting the insertion point in NSTextView
Re: setting the insertion point in NSTextView
- Subject: Re: setting the insertion point in NSTextView
- From: Timothy Ritchey <email@hidden>
- Date: Fri, 7 Feb 2003 10:35:42 -0500
If you want to set the insertion point to charIndex, you should do
something like:
[aTextView setSelectedRange: NSMakeRange(charIndex, 0)];
Cheers,
tim
On Friday, February 7, 2003, at 10:12 AM, Koen van der Drift wrote:
Hi,
I have an NSTextView that uses temporary attributes to hilite certain
characters. This now all works fine. But when I insert a character in
the text, after setting the attributes, the cursor/drawcaret/insertion
point moves to the end of the text. So I thought I get the position of
the insertionpoint (using selectedRange, range.location is where the
insertion point is), change the attributes, and then set the insertion
point back to the 'correct' position. The only method I found to set
the insertionpoint is drawInsertionPointInRect. How do I convert the
location to a Rect?
thanks,
- Koen.
_______________________________________________
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.
_______________________________________________
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.