Detecting a paste operation in NSTextView
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.