Perform additional action when window receives any mouse- or keyDown

2010-02-16 Thread Jerry Krinock
At times, I attach an attached window to a document window. I would like this window to go away whenever the user clicks anything in the window, kind of like a tooltip. So I subclassed the window, overrode -sendEvent:, invoke super and post a notification for which my window controller

Re: Perform additional action when window receives any mouse- or keyDown

2010-02-16 Thread Paul Sanders
-[NSWindow mouseDown:]? (inherited from NSResponder). Paul Sanders. - Original Message - From: Jerry Krinock je...@ieee.org To: Cocoa Developers cocoa-dev@lists.apple.com Sent: Tuesday, February 16, 2010 5:48 PM Subject: Perform additional action when window receives any mouse

Re: Perform additional action when window receives any mouse- or keyDown

2010-02-16 Thread Jerry Krinock
On 2010 Feb 16, at 10:58, Paul Sanders wrote: -[NSWindow mouseDown:]? (inherited from NSResponder). Thanks, Paul. I hadn't realized that inheritance. Also, I'd need -rightMouseDown:, -keyDown:, -otherMouseDown:, ??? At least, no notification needed.

Re: Perform additional action when window receives any mouse- or keyDown

2010-02-16 Thread Kyle Sluder
On Tue, Feb 16, 2010 at 9:48 AM, Jerry Krinock je...@ieee.org wrote: So I subclassed the window, overrode -sendEvent:, invoke super and post a notification for which my window controller registers, and in the notification handler I examine the event type.  It works, but this seems quite

Re: Perform additional action when window receives any mouse- or keyDown

2010-02-16 Thread Paul Sanders
, 2010 9:56 PM Subject: Re: Perform additional action when window receives any mouse- or keyDown On Tue, Feb 16, 2010 at 9:48 AM, Jerry Krinock je...@ieee.org wrote: So I subclassed the window, overrode -sendEvent:, invoke super and post a notification for which my window controller

Re: Perform additional action when window receives any mouse- or keyDown

2010-02-16 Thread Murat Konar
Uh, if I understand what the op wants to do correctly, overriding - [NSWindow mouseDown:] isn't going to do it. If the user clicks inside a view that overrides -mouseDown: (and friends -rightMouseDown: and -otherMouseDown:), there's no guarantee that your window's override will get called.