Re: Advanced NSTextView use
Re: Advanced NSTextView use
- Subject: Re: Advanced NSTextView use
- From: Martin Wierschin <email@hidden>
- Date: Tue, 3 Feb 2009 23:08:46 -0800
On Feb 3, 2009, at 5:24 PM, Chris Idou wrote:
So I want it that if you try and delete any character that is part
of a token, it deletes the entire token.
So I'm overriding rangeForUserTextChange to return a different
range if the current range includes any part of a token.
This seems to work if the user tries to type in any part. For
example, clicking on the token and pressing space bar or a letter.
However, it doesn't work if you press backspace or delete, even
though rangeForUserTextChange is still called.
I don't think you really want to override that method. Instead
override -[NSTextView selectionRangeForProposedRange:granularity:]
which should be called for every selection the user makes.
~Martin
_______________________________________________
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