Re: Turning off Auto Complete feature for NSTextField
Re: Turning off Auto Complete feature for NSTextField
- Subject: Re: Turning off Auto Complete feature for NSTextField
- From: Douglas Davidson <email@hidden>
- Date: Tue, 28 Oct 2008 08:55:42 -0700
On Oct 28, 2008, at 5:59 AM, Adil Saleem wrote:
I am encountering a small problem. I am using a simple NSTextField
in my application. This textfield is editable. When user starts
entering some text, the auto complete is by default ON, so on
pressing escape key a list of suggestions is displayed. I don't want
this feature. How can i turn off the auto complete feature for
NSTextField. I couldn't find any option in Interface Builder or the
documentation of NSTextField.
This is not autocompletion; this is completion upon user request, and
we provide many APIs to control it. The simplest would be to use the
NSControl delegate method -
control:textView:completions:forPartialWordRange:indexOfSelectedItem:
if you are using an NSTextField, or the NSTextView delegate method -
textView:completions:forPartialWordRange:indexOfSelectedItem: if you
are using an NSTextView. The proposed array of completions is passed
in, and the delegate can modify this list and return it, or return nil
to suppress completion. The index of the initially selected
completion can also optionally be set.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden