NSRect for intertion point in NSTokenField (or NSTextField)
NSRect for intertion point in NSTokenField (or NSTextField)
- Subject: NSRect for intertion point in NSTokenField (or NSTextField)
- From: Justin Hawkwood <email@hidden>
- Date: Fri, 4 Apr 2008 11:49:19 -0700
I'm working on making a NSTokenField inside of a NSScrollView work
properly so that keying through the tokens adjusts the scroll view to
keep the insertion point visible. I've subclassed NSTokenField and am
catching the textViewDidChangeSelection: notification, but I don't
know how to find the rect for the insertion point (or selectedRange).
With that, I could then call
[self scrollRectToVisible:insertionRect];
and the scrollView would do the rest.
So, is there something obvious I'm missing that does this? If not,
since the tokenfield wraps, is there a way to find out what line the
insertion point is on so that I can calculate the rect?
Thanks.
~ Justin Hawkwood
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden