Mouse tracking under a transparent view still working
Mouse tracking under a transparent view still working
- Subject: Mouse tracking under a transparent view still working
- From: Navneet Kumar <email@hidden>
- Date: Sun, 11 Jan 2015 11:42:39 +0530
Hi,
I have a hover button in my window, implemented tracking area and mouseEntered: and mouseExited: to achieve this (the button draws a border around it on mouse entered).
Now sometimes I need to put a window size transparent view over the entire window and block mouse events from filtering through it to the views under it.
For this I have implemented the following methods in transparent view:
- (void)mouseDown:(NSEvent*)event {}
- (void)mouseDragged:(NSEvent*)event {}
- (void)mouseUp:(NSEvent*)event {}
- (void)mouseEntered:(NSEvent *)theEvent {}
- (void)mouseExited:(NSEvent *)theEvent {}
- (void)mouseMoved:(NSEvent *)theEvent {}
- (BOOL)acceptsFirstResponder {
return YES;
}
So the mouse click etc are not passing through, but the hover button under it still shows hovering effect by drawing the border.
Please help.
Regards,
Navneet
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden