I think this should be quite simple, but I cannot make it work.
I want to detect mouse clicks on a WebView...
I've 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've checked in runtime and the object is a ResultsWebView, but the mouseDown event is never called...
What am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…