On Oct 28, 2008, at 8:42 AM, [EMAIL PROTECTED] wrote:

 Turning off Auto Complete feature for NSTextField
To: cocoa-dev@lists.apple.com
Message-ID: <[EMAIL PROTECTED]>
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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to