code_junkie

How to make a transparent NSView subclass handle mouse events?

Nov 13th, 2011
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. [[NSColor colorWithCalibratedRed:0.01 green:0.01 blue:0.01 alpha:0.05] set];
  2.  
  3. - (NSView *)hitTest:(NSPoint)aPoint
  4.  
  5. - (NSView *)hitTest:(NSPoint)aPoint
  6. {
  7. NSView * clickedView = [super hitTest:aPoint];
  8. if (clickedView == nil)
  9. {
  10. clickedView = self;
  11. }
  12.  
  13. return clickedView;
  14. }
Add Comment
Please, Sign In to add comment