• 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
Advanced NSTextView use
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Advanced NSTextView use


  • Subject: Advanced NSTextView use
  • From: Chris Idou <email@hidden>
  • Date: Tue, 3 Feb 2009 17:24:55 -0800 (PST)

I'm trying to use NSTextView so that it has tokens in the text (kind of like NSTokenField).

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. In this case it does nothing if the range is zero length, or it does the  normal thing and ignores my range, if the user starts off with a range selected.

Has anyone got any other ideas how to achieve this?



      Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox
_______________________________________________

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: Advanced NSTextView use
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: Re: problems resetting timer interval.
  • Next by Date: Keyword Filtering & Weekday Selection
  • Previous by thread: Re: problems resetting timer interval.
  • Next by thread: Re: Advanced NSTextView use
  • Index(es):
    • Date
    • Thread