Reputation: 1477
In my macOS app, I created a custom shaped window which visible frame is less than actual. I want to make invisible areas inactive for user interactions. I've played with NSWindow
's frameRect(forContentRect contentRect: NSRect)
and other methods, tracking areas of it's contentView
but achieve no success. Is it possible or I'm just wasting time?
Upvotes: 1
Views: 257
Reputation: 50129
Making a custom window starts with a transparent window. => that makes OSX pass through clicks on non-opaque areas of the window
In your window subclass you gotta override init and set opaque to NO
I could reiterate all from the old bbut good cocoawithlove tutorial bbut instead, ill link it: https://www.cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html
Upvotes: 1