NSPopover autocomplete for NSTextView

I am trying to figure out how to create an NSTextView autocomplete. The idea I'm trying to implement is to show NSPopover a list of possible usernames, for example: http://cl.ly/McZ0 . The purpose of this is to work just like Tweetbot for Mac, the more you type, the more it filters the list. I looked through both

- (NSArray *)textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index

      

and

- (NSArray *)completionsForPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index for the autocompletion. 

      

I found out that none of these are relevant to what I am trying to do, so I looked through

- (void)textDidChange:(NSNotification *)notification

      

and

- (void)controlTextDidChange:(NSNotification *)notification

      

I guess I'll need to find the dot where the "@" is and use the characters after the "@" to filter the list. What I'm really stuck with is representing the NSPopover under the word in the NSTextView. Anyone have any ideas on how to do this?

+3
autocomplete nstextview nspopover


source to share


No one has answered this question yet

Check out similar questions:

620
Disable Chrome Autofill
143
Browser autocomplete detection
nine
How to create an NSPopover software package
nine
Completion in NSTextView
4
Convert NSTextView coordinates to screen coordinates
3
NSPopover below caret in NSTextView
1
NsPopover triangle does not appear on popover
1
autocomplete combobox for vb.net word by word or delimited
0
Angular - move focus from input field to list
0
NSTextView or NSTextField automatically resize frame / border?



All Articles
Loading...
X
Show
Funny
Dev
Pics