• 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: NSTextView insertText & undo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView insertText & undo


  • Subject: Re: NSTextView insertText & undo
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 26 May 2005 17:19:11 -0700


On May 26, 2005, at 4:59 PM, Glen Simmons wrote:

Well, the requirement I have is to translate a particular set of characters into images and not allow any other characters. I don't really care where I catch them, I just need to change what gets inserted and disallow other characters. I think I was passing nil for the replacement string because I'm not actually inserting a string, I'm inserting the NSAttributedString/NSTextAttachment thing and -shouldChangeTextInRange:replacementString: takes an NSString. How should this be done so that it works nicely with keyboard entry, paste and undo?


Often the easiest way to do this sort of thing is with a formatter, for example on an NSTextField. However, it can be done manually; exactly how depends on exactly what you want to do. For example, what do you intend should happen on copy and paste?


Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSTextView insertText & undo (From: Glen Simmons <email@hidden>)
 >Re: NSTextView insertText & undo (From: Douglas Davidson <email@hidden>)
 >Re: NSTextView insertText & undo (From: Glen Simmons <email@hidden>)

  • Prev by Date: Re: Many many tabs
  • Next by Date: Re: Stupid newbie question...
  • Previous by thread: Re: NSTextView insertText & undo
  • Next by thread: Stupid newbie question...
  • Index(es):
    • Date
    • Thread