Re: Working with NSTextFields
Re: Working with NSTextFields
- Subject: Re: Working with NSTextFields
- From: Alex Hall <email@hidden>
- Date: Tue, 15 Sep 2015 20:29:38 -0400
That's what I get for assuming. :) I figured text fields were for editing text, and text views were for displaying it. Needless to say, I was completely and profoundly wrong! This text view and related pieces are doing precisely what I wanted; spellcheck, substitutions, no selecting when the app inserts text, etc. I can even support tab and enter for moving/submitting by making my view controller the delegate!
My only remaining wonder is about setting the accessibilityHelp property, which is giving me the same error it always has: self is immutable. This isn't a show-stopper, but it would be really nice to be able to change this according to different user actions.
> On Sep 15, 2015, at 13:20, Jens Alfke <email@hidden> wrote:
>
>
>> On Sep 15, 2015, at 9:11 AM, Alex Hall <email@hidden> wrote:
>>
>> * When I call myField.stringValue="some text", that string ("some text") appears as expected, but it's highlighted. That means that, when the user starts typing, it disappears, defeating the purpose of the app putting it there for the user in the first place.
>
> That’s the standard behavior for text fields. It lets the user tab through a dialog box and either accept the default value or quickly type in a new one.
>
>> * My field currently doesn't allow spellchecking or auto-correct, but I want it to. I don't see that option anywhere in the inspectors, for the field or its child cell.
>
> This is probably a side effect of the fact that all text fields (and text cells in general) in the window share the same NSTextView, called the “field editor”. So by default they’re using the characteristics of that view.
>
> You can override either of those behaviors, but it sounds like you may want to use an NSTextView instead of an NSTextField in your UI, since its behavior isn’t typical and you want to enable extra features.
>
> —Jens
>
--
Have a great day,
Alex Hall
email@hidden
_______________________________________________
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