On 16/11/2010, at 11:26 PM, eveningnick eveningnick wrote:

> I a wondering, if it is possible to get the current screen position of
> a text cursor (text caret) using Cocoa? It is possible to do that in
> Windows system (GetCaretPos), maybe Mac allows some similar
> functionality?


The text caret doesn't have a single, global position. It is really the 
position of the text selection within an active text view when the selection 
length is zero. If you want to know which logical characters the insertion 
point is at in a given text view, that's easy to find - just get the selection 
range and the location field is the position of interest. The text system has 
methods to convert the logical character position to a view position and from 
there to a screen position, but why do you want that? In other words, what are 
you really trying to do?

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to