开发者

Prevent an instance of NSView from receiving mouse events

开发者 https://www.devze.com 2023-01-15 20:16 出处:网络
I have an NSView in a window with core animation layer turned on. I use this view to display images with animation from time to time. I need t开发者_StackOverflow社区he entire view to be the back laye

I have an NSView in a window with core animation layer turned on. I use this view to display images with animation from time to time. I need t开发者_StackOverflow社区he entire view to be the back layer not only the images. Behind this view which I call AnimationBaseView are other views which the user interacts to.

Everything is ok except the AnimationBaseView prevents the other views from getting rightMouseDown events.

I've tried the following:

  • returning NO to acceptsFirstResponder to AnimationBaseView
  • Hiding and unhiding the AnimationBaseView as needed, but produces a nasty flicker.

Thank you for your help, Jose.


Override - (NSView *)hitTest:(NSPoint)aPoint to return either nil or the view that should handle the mouse events

0

精彩评论

暂无评论...
验证码 换一张
取 消