Re: determining dragging source
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.