• 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: determining dragging source
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: determining dragging source


  • Subject: Re: determining dragging source
  • From: Brian Webster <email@hidden>
  • Date: Fri, 26 Jul 2002 13:44:02 -0500

On Friday, July 26, 2002, at 12:54 PM, cocoa-dev-
email@hidden wrote:

I my app the user can drag items from a palette to the main window to
construct a graph. I only send a tag in the drag, and 'unpack' it when the
drag is accepted. The tag is an NSString, so I want to make sure that not
every string dragged into the image gets processed. How do I know which
view is the sender if the sourceview is in another window ? I know that the
NSDraggingInfo has a sender member and I can do if (sender != self), but I
don't know how to test that for whatever view/window it is coming from. If
this is not possible, at least I want to make sure that drag is within my
app. How can that be accomplished?

Just declare another pasteboard type (any string will do) and use that instead of NSStringPboardType. You can still use the setString:forType: method of NSPasteboard, but if you use a different type, then you can only register your view to accept your internal drag type and it will ignore any strings dragged in from other applications.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.

  • Prev by Date: Re: Links in RTF
  • Next by Date: MPEG-4 in NSMovieView - RED FLAG!
  • Previous by thread: determining dragging source
  • Next by thread: Re: determining dragging source
  • Index(es):
    • Date
    • Thread