Re: NSTextField selection customization
Re: NSTextField selection customization
- Subject: Re: NSTextField selection customization
- From: Graham Cox <email@hidden>
- Date: Wed, 16 Jun 2010 11:46:50 +1000
On 16/06/2010, at 6:16 AM, vincent habchi wrote:
> Le 15 juin 2010 à 21:58, Jens Alfke a écrit :
>
>> You’ll end up working with NSTextView regardless. NSTextField doesn’t do its own text editing, it overlays a text view called the ‘field editor’ that’s used by all controls in the window. So to make this work in a text field you’d need to create a tricked-out text view and then install it as a custom field editor on that text field.
>
> Thanks for the answer, that's what I suspected. Before getting on, what, in your opinion, is the most handy solution? In order, what would you advise : NSTextView or a custom field editor?
>
> Vincent_______________________________________________
Note that NSTextView has: - (void)setSelectionGranularity:(NSSelectionGranularity)granularity
which might be all you need - just set it to NSSelectByWord every time you change the selection. This will keep getting reset so something will need to keep forcing it back to 'word' selection, but it might be possible to do this in the delegate and not require a subclass.
--Graham
_______________________________________________
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