I have a Cocoa application based on a document with TextView, and I would like to capture clicks on it, so I'm trying to intercept Window events such as mouseDown, mouseUp, etc., then link them to my TextView.
I tried two things:
1.) I made TextView the initial first responder for the window of my document and redefined the mouseDown event in my document class, but didn't hit.
2.) I subclassed NSWindow and redefined mouseDown and set this subclass to my Window class in my xib document. This event also did not hit.
I noticed that the Window delegate is already set up for my file owner, which is my subclass of NSDocument. Why in my NSDocument events do not fire if my subclass of documents is a delegate for my window?
source
share