Re: NSTextField caret position
Re: NSTextField caret position
- Subject: Re: NSTextField caret position
- From: Douglas Davidson <email@hidden>
- Date: Tue, 10 Apr 2007 08:44:06 -0700
On Apr 10, 2007, at 1:22 AM, xcocoa wrote:
Is there a way to Set/Get the caret position in a NSTextField ?
An NSTextField doesn't have an insertion point when it isn't editing,
and when it is editing you can use -currentEditor to obtain the field
editor. The field editor will be an NSTextView, and you can use
standard NSTextView methods to obtain the selected range(s). If
there is a single zero-length selected range, that is the insertion
point. If you want to obtain its position on the screen, there are
NSLayoutManager methods for that too.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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