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: John Joyce <email@hidden>
- Date: Tue, 28 Oct 2008 09:40:28 -0500
On Oct 28, 2008, at 8:42 AM, email@hidden wrote:
Turning off Auto Complete feature for NSTextField
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii
Hi,
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.
Thanx
Are you sure you're using NSTextField and not NSTextView?
The behavior is part of NSTextView and the two are a bit different.
You'll need to override some methods, so you'll want to subclass.
You might be surprised how often the completion is available in apps.
NSTextField does not appear to have the same methods.
Oddly, both do have the Delegate method
control:textView:completions:forPartialWordRange:indexOfSelectedItem:
This is pretty simple to take over.
You just hijack it by giving it nothing!
An empty array. Of course this will still give you the system alert
sound if esc is pressed to autocomplete.
The normal set of completions will come from Dictionary.app so they
will be locale-dependent.
_______________________________________________
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