Re: NSDraggingInfo question
Re: NSDraggingInfo question
- Subject: Re: NSDraggingInfo question
- From: Tim Hewett <email@hidden>
- Date: Sun, 2 May 2004 20:41:35 +0100
Moray,
Try this code as an additional method in a subclass of your view:
- (BOOL)pointAtDescendant:(NSPoint)potentialDescendant
{
return [[self hitTest:[[self superview] convertPoint:[[self window]
convertScreenToBase:potentialDescendant] fromView:nil]]
isDescendantOf:self];
}
When the drop occurs your view can test to see if the point is
within it. When the view receives the point of the drop location,
have it call [self pointAtDescendant:theDropPoint] which should
return TRUE if the point is contained in your view or any descendant
of it.
This has only just been written today, following my separate thread
about promised file drag/drop issues, but it seems to work ok so
far. There may be a better way but so far much searching hasn't
found it.
Regards,
Tim.
On 2 May 2004, at 19:38, email@hidden wrote:
Hi,
I am trying to drag an image onto an NSView, this is working fine
(thanks Allan), but I am using NSDraggingInfo.draggingLocation to get
the location of the drop, which gives me the point in the window, I
want the point in my NSView, as it is quite deeply nested with
ScrollViews etc.., it would be tricky to work this out myself, is there
a magic way of doing this.
Thanks
Moray
_______________________________________________
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.