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

Re: Detecting a paste operation in NSTextView


  • Subject: Re: Detecting a paste operation in NSTextView
  • From: Jeremy Dronfield <email@hidden>
  • Date: Mon, 29 Mar 2004 21:59:12 +0100

Douglas gallops to the rescue again! I've implemented it like so:

- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSString *)type
{
[self setIsPasteOperation:YES];
return [super readSelectionFromPasteboard:pboard type:type];
}

Works beautifully. Thanks loads.

-Jeremy

===================================
SkoobySoft, home of viJournal
email: email@hidden or visit:
http://freespace.virgin.net/jeremy.dronfield/skoobysoft.html
===================================

On 29 Mar 2004, at 7:38 pm, Douglas Davidson wrote:


You can subclass NSTextView and override readSelectionFromPasteboard:type:. That would catch paste, paste as rich/plain text, drag and drop of text, dragging in of files, pasting rulers, etc. Alternatively, you could override insertText:, which is the funnel point for insertion by typing.

Douglas Davidson
_______________________________________________
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.


References: 
 >Detecting a paste operation in NSTextView (From: Jeremy Dronfield <email@hidden>)
 >Re: Detecting a paste operation in NSTextView (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Using IP or hostname for NSConnections rootProxyForConnectionWithRegisteredName:host:
  • Next by Date: drawrect not being called after a random time in NSOpenGLView
  • Previous by thread: Re: Detecting a paste operation in NSTextView
  • Next by thread: NSMailDelivery with HTML
  • Index(es):
    • Date
    • Thread