I think it should be pretty simple, but I can't get it to work.
I want to detect mouse clicks in a WebView ...
I have subclassed WebView, here is the code
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
@interface ResultsWebView : WebView {
}
@end
and
#import "ResultsWebView.h"
@implementation ResultsWebView
- (void)mouseDown:(NSEvent *)theEvent {
NSLog(@"%@", theEvent);
}
@end
In my xib file, I added a WebView and then changed the class to ResultsWebView.
I checked at runtime, and the object is the result of a WebView, but the mouseDown event is never raised ...
What am I missing?
source
share