• 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: unable to catch mouseDown
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unable to catch mouseDown


  • Subject: Re: unable to catch mouseDown
  • From: Ken Ferry <email@hidden>
  • Date: Sun, 1 Feb 2009 13:27:46 -0800

Hi Jeffrey,
> It behaves as if the Matrix lies on top of the view and not as if the
click has to get through the custom view to the Matrix which is a subview.

That is exactly how clicks work.  The first view to receive mouseDown: is
the _deepest_ view that it the click hits. Please see the Cocoa event
handling guide for more details, <
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/EventOverview/Introduction/chapter_1_section_1.html
>.

You can modify the view that first receives -mouseDown: by overriding
-[NSView hitTest:].  It's relatively rare though, and more useful when you
do not know what your subviews will be.   Please consider if a plain
NSMatrix is appropriate as a subview in the first place!

-Ken

On Sun, Feb 1, 2009 at 6:47 AM, Jeffrey Goines <
email@hidden> wrote:

> Hello.
> I have a custom view to which I add a NSMatrix as subview.
>
> I've set the target and action of the cells and it's working like I want.
>
> Now I want to introduce some mode in which the behaviour is different.
> A mouseclick should no longer trigger the action.
> I want to catch the click in the view and process it further there since
> it's the appropriate place.
>
> I've tried setting the view to acceptFirstResponder and the Matrix to
> resignFirstResponder,
> yet it's not working.
> It behaves as if the Matrix lies on top of the view and not as if the click
> has to get through
> the custom view to the Matrix which is a subview.
> I don't understand that.
>
> Thanks!
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >unable to catch mouseDown (From: Jeffrey Goines <email@hidden>)

  • Prev by Date: Re: Drawing Invalidation Question
  • Next by Date: Re: maximum theoretical speedup with dual quad processors
  • Previous by thread: unable to catch mouseDown
  • Next by thread: Re: Core Data relationship disappears
  • Index(es):
    • Date
    • Thread