Hi Germán,

> Not the mouse cursor, is the i-beam cursor. I don't have a Mac to see how
> this works under Cocoa. But, for example, in this image:
> 
> http://www.creativetechs.com/iq/tip_images/OSX-Autocomplete.png
> 
> I imagine the window appears under the word you are typing. So, I need
> know where is typing the user.
> 
> Germán.

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.

Eric
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to