MT.
MT.

Reputation: 237

Custom NSTextView autocompletion menu

How would one implement a custom auto-complete pop-up menu like Xcode has?

At the moment I can only put custom auto-completions using

- (NSArray *)textView:theTextView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(int *)index 

I want a bit more flexibility than this.

Cheers!

MT

Upvotes: 2

Views: 2049

Answers (1)

Saurabh Sharan
Saurabh Sharan

Reputation:

Xcode (and other apps) use a custom auto-completion view. You can bring up your view at the correct location using the text view's layout manager's method locationForGlyphAtIndex: (which return an NSPoint).

Upvotes: 4

Related Questions