• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextField selection customization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSTextField selection customization
      • From: vincent habchi <email@hidden>
References: 
 >NSTextField selection customization (From: vincent habchi <email@hidden>)
 >Re: NSTextField selection customization (From: Jens Alfke <email@hidden>)
 >Re: NSTextField selection customization (From: vincent habchi <email@hidden>)

  • Prev by Date: Re: Service without Icon or Window?
  • Next by Date: Re: NSTextField selection customization
  • Previous by thread: Re: NSTextField selection customization
  • Next by thread: Re: NSTextField selection customization
  • Index(es):
    • Date
    • Thread