• 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: Converting View Coordinates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting View Coordinates


  • Subject: Re: Converting View Coordinates
  • From: "John C. Randolph" <email@hidden>
  • Date: Tue, 15 Jan 2002 22:26:08 -0800

On Tuesday, January 15, 2002, at 10:07 PM, Alex Keresztes wrote:

> In my project I have my own custom view that overrides the
>
> - (void)mouseDown: (NSEvent *)theEvent
>
> so I can handle mouse clicks on that view.
>
> I can get the screen coordinates on where the mouse was clicked
> by [theEvent locationInWindow]
> which returns an NSPoint.
>
> My question is if there is any way to convert the coordinates
> from the window coordinates to my
> custom view's coordinates? I could potentially do this myself
> but I was wondering if anyone knew of
> any such functions?

- (void)mouseDown: (NSEvent *)theEvent
{
NSPoint
where = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
// etc.
}


-jcr


"These kids today don't know the simple joy of saving four bytes
of page-0 memory on a 6502" - unknown


References: 
 >Converting View Coordinates (From: Alex Keresztes <email@hidden>)

  • Prev by Date: Converting View Coordinates
  • Next by Date: Re: Converting View Coordinates
  • Previous by thread: Converting View Coordinates
  • Next by thread: Re: Converting View Coordinates
  • Index(es):
    • Date
    • Thread