• 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: NSDraggingInfo question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Loco Cocoa Compiler
  • Next by Date: BezierPathLab - multiple images on screen at once
  • Previous by thread: Re: NSDraggingInfo question
  • Next by thread: Windows controlled by mouse clicks and keystrokes
  • Index(es):
    • Date
    • Thread