• 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: NSView clicking through to superview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView clicking through to superview


  • Subject: Re: NSView clicking through to superview
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 28 Sep 2009 19:07:03 -0700

On Sun, Sep 27, 2009 at 7:36 PM, PCWiz <email@hidden> wrote:
> I have a transparent black NSView that I layer over my window using NSView's
> addSubview method. This works fine, but I want to make it so that all clicks
> are captured by the NSView, because right now I can click through to the
> superview underneath. I've already tried returning NO for acceptsFirstMouse
> and it has no effect.

-acceptsFirstMouse: (note the colon) has nothing to do with this.
That determines whether clicking on the control when the window is not
main will cause the event to be dispatched to that view or if it will
simply be dropped on the floor when the window activates.  Typically,
UI controls that could cause destructive changes (like a Delete
toolbar item) return NO, whereas non-destructive controls (like the
toolbar show/hide widget in the titlebar) return YES.

Have you followed Mike Abdullah's advice and overridden -mouseDown:?
The documentation for this method describes exactly why you are seeing
what you are seeing.  In fact, I would have expected that to be the
first thing you would have tried.  If it wasn't, maybe it's worth
seeing if the documentation can be improved to nudge people in this
direction in the future.

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: NSView clicking through to superview
      • From: PCWiz <email@hidden>
References: 
 >NSView clicking through to superview (From: PCWiz <email@hidden>)

  • Prev by Date: Re: NSView clicking through to superview
  • Next by Date: Crash in +[NSMethodSignature signatureWithObjCTypes:]
  • Previous by thread: Re: NSView clicking through to superview
  • Next by thread: Re: NSView clicking through to superview
  • Index(es):
    • Date
    • Thread