• 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: NSTextField caret position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTextField caret position (From: xcocoa <email@hidden>)

  • Prev by Date: Re: Retrieving URL from NSImage
  • Next by Date: Re: Multi windows in Document-based app, but 1 Nib
  • Previous by thread: NSTextField caret position
  • Next by thread: Access Core Data from Multiple Apps?
  • Index(es):
    • Date
    • Thread