I want to get the screen location (NSPoint) of a point in an NSTextView, it should be simple, but by the results the bit is always off, X is perfect, but Y seems to be changing.
I tried several code options below, but can't get the result I need - is it NSClipView by screwing it in?
NSPoint p = [[self layoutManager] locationForGlyphAtIndex:r.location];
NSPoint screenlocation = [self convertPointToBase:p];
Any ideas?
Hooray!
MT
source
share