Re: NSView clicking through to superview

2009-09-29 Thread PCWiz
Earlier I did try mouseDown:, and it did capture all the clicks (which is what I wanted), but I was not sure on how to implement it. How would I override it so that clicks would not pass through to the superview? On 2009-09-28, at 8:07 PM, Kyle Sluder wrote: On Sun, Sep 27, 2009 at 7:36

Re: NSView clicking through to superview

2009-09-29 Thread Kyle Sluder
Just don't propagate it. This is what the NSResponder implementation of -mouseDown: looks like: - (void)mouseDown:(NSEvent *)theEvent { [[self nextResponder] mouseDown:theEvent]; } All you have to do is *not* do that line, and *not* call super's implementation. --Kyle Sluder

Re: NSView clicking through to superview

2009-09-29 Thread PCWiz
Thanks On 2009-09-29, at 9:49 PM, Kyle Sluder kyle.slu...@gmail.com wrote: Just don't propagate it. This is what the NSResponder implementation of -mouseDown: looks like: - (void)mouseDown:(NSEvent *)theEvent { [[self nextResponder] mouseDown:theEvent]; } All you have to do is *not* do

Re: NSView clicking through to superview

2009-09-28 Thread Mike Abdullah
You want to read up on how event handling in Cocoa works. When you click, the window is sending events to your overlay view. But if that view does not handle the event itself, it forwards it on to the next view below the mouse. So, you need to override the required event handling methods

Re: NSView clicking through to superview

2009-09-28 Thread Jesper Storm Bache
Return self from hitTest inside your overlay view. Jesper On Sep 27, 2009, at 7:36 PM, PCWiz wrote: Hi, 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,

Re: NSView clicking through to superview

2009-09-28 Thread PCWiz
Tried this earlier but it had no effect... On 2009-09-28, at 7:57 AM, Jesper Storm Bache wrote: Return self from hitTest inside your overlay view. Jesper On Sep 27, 2009, at 7:36 PM, PCWiz wrote: Hi, I have a transparent black NSView that I layer over my window using NSView's addSubview

Re: NSView clicking through to superview

2009-09-28 Thread Kyle Sluder
On Sun, Sep 27, 2009 at 7:36 PM, PCWiz pcwiz.supp...@gmail.com 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

NSView clicking through to superview

2009-09-27 Thread PCWiz
Hi, 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

Re: NSView clicking through to superview

2009-09-27 Thread Ron Fleckner
On 28/09/2009, at 12:36 PM, PCWiz wrote: Hi, 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