Skip to content

Instantly share code, notes, and snippets.

@chamons

chamons/foo.m Secret

Created December 3, 2014 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamons/46d4042f64b6107a6a4a to your computer and use it in GitHub Desktop.
Save chamons/46d4042f64b6107a6a4a to your computer and use it in GitHub Desktop.
@interface MyView : NSView
@end
@implementation MyView
- (void)awakeFromNib {
NSTrackingArea * a = [[NSTrackingArea alloc]initWithRect:[self bounds] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways | NSTrackingEnabledDuringMouseDrag owner:self userInfo:nil];
[self addTrackingArea:a];
}
- (void) mouseEntered:(NSEvent *)theEvent
{
NSLog (@"%d", theEvent.clickCount);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment