• 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
Problems with hitTest and mouseDown in my subview.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with hitTest and mouseDown in my subview.


  • Subject: Problems with hitTest and mouseDown in my subview.
  • From: "Carter R. Harrison" <email@hidden>
  • Date: Sat, 14 Oct 2006 09:56:00 -0400

I'm kind of just starting with Cocoa so please excuse me if this is a complete newb question.

I've got a subview that we'll call superview. It's got some other custom subview that we'll call subviews. I want to detect mouse clicks on my superview - I don't want the clicks to be passed down the responder chain to the subviews. So I implemented hitTest in my superview and it returns itself to keep the click from being passed down to the subview. So then in my mouseDown method within the superview I handle the click. But the problem is that the point I receive from the mouseDown's NSEvent is always (0, 0). So I figured that maybe I need to convert the point to the superview's local coordinate system using:

NSPoint event_location = [theEvent locationInWindow];
NSPoint local_point = [self convertPoint:event_location fromView:nil];

And of course this still returns (0, 0) as the point in superview's local coordinate system. What's going on here and why would I be receiving (0, 0)? Thanks in advance.

Regards,
Carter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Core Data: different fetch performance when launching app [SOLVED]
  • Next by Date: [SOLVED] How to receive text color changes from NSFontPanel?
  • Previous by thread: Re: Checking for internet connection?
  • Next by thread: Localising Preference Panes
  • Index(es):
    • Date
    • Thread