Re: [NSTextView] Is there a workaround for Snow Leopard new word selection behavior/bug?
Re: [NSTextView] Is there a workaround for Snow Leopard new word selection behavior/bug?
- Subject: Re: [NSTextView] Is there a workaround for Snow Leopard new word selection behavior/bug?
- From: Ken Thomases <email@hidden>
- Date: Thu, 2 Sep 2010 16:06:29 -0500
On Sep 2, 2010, at 2:42 PM, Stephane Sudre wrote:
> I need to detect double-click on a word when the alt key is hold down
> (to do something similar to what Xcode does).
> This does not work as well in Mac OS X 10.6.
>
> Because when you double-click on the word myclass in a text like this:
>
> myclass.mymethod
>
> this selects myclass.mymethod.
>
> On previous OS versions, only myclass was selected.
This is a distinction between the U.S. and U.S. (Computer) regions in the Formats tab of the Language & Text pane of System Preferences.
This affects the -doubleClickAtIndex: and -nextWordFromIndex:forward: methods of NSAttributedString (and its subclass NSTextStorage). It may be possible to set up your text view to use a custom subclass of NSTextStorage that overrides the behavior of those methods.
Cheers,
Ken
_______________________________________________
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