|
From: | Germán Arias |
Subject: | Re: Position of I-beam cursor |
Date: | Mon, 27 May 2013 01:42:52 -0600 |
User-agent: | GNUMail (Version 1.2.0) |
Sounds like a cool project! The I beam is called the "insertion point" in NSTextView. You can get the character index of it using[self selectedRange]inside NSTextView. The I-beam is only present if length == 0 and location != NSNotFound.To get the (x,y) coordinates for positioning the popup window, you can use -firstRectForCharacterRange:. (NSTextInput protocol). Note that apple's docs say this returns a result in screen coordinates, but our NSTextView's implementation doesn't seem to do that.
Thanks. I will check this.
Eric
[Prev in Thread] | Current Thread | [Next in Thread] |