• 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
Detecting a paste operation in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Detecting a paste operation in NSTextView


  • Subject: Detecting a paste operation in NSTextView
  • From: Jeremy Dronfield <email@hidden>
  • Date: Sat, 27 Mar 2004 18:47:06 +0000

I have a situation in which I would like my text view delegate to be able to tell whether input text is pasted or not. I'm using -textView:shouldChangeTextInRange:replacementString: to modify input text, and would like to be able to do something like:


- (BOOL)textView:(NSTextView *)theTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString
{
if (!isPasteOperation) {
// do stuff to the string and insert it
}

// leave pasted text untouched
return YES;
}

Is there an easy way of telling whether replacementString is being typed or pasted?

-Jeremy

===================================
SkoobySoft, home of viJournal
email: email@hidden or visit:
http://freespace.virgin.net/jeremy.dronfield/skoobysoft.html
===================================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Detecting a paste operation in NSTextView
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: NSTableView tooltips
  • Next by Date: NSMailDelivery with HTML
  • Previous by thread: Re: NSTableView tooltips
  • Next by thread: Re: Detecting a paste operation in NSTextView
  • Index(es):
    • Date
    • Thread