How to make a transparent NSView subclass handle mouse events?

后端 未结 7 1701
清歌不尽
清歌不尽 2021-02-04 10:31

The problem

I have a transparent NSView on a transparent NSWindow. The view\'s drawRect: method draws some content (NSIma

7条回答
  •  你的背包
    2021-02-04 10:59

    I had the same problem. It looks like [window setIgnoresMouseEvents:NO] will do it.

    (On Lion, at least. See http://www.cocoabuilder.com/archive/cocoa/306910-lion-breaks-the-ability-to-click-through-transparent-window-areas-when-the-window-is-resizable.html)

提交回复
热议问题