I’m making a loupe style application in osx for fun and I ran into a snag I can’t seem to find the answer to.
I have a NSView inside an NSWindow I set the view to clearColor and the alpha to .25, but I cannot figure out how to make the NSWindow transparent behind the NSView so you can see things below the application when it’s selected.
Been digging through doc’s can’t seem to find what I’m looking for any thoughts?
Thanks
Perhaps try NSWindow’s
setOpaque:and you also need to set the window’s background color with a transparent color (setBackgroundColor:)Here is my quick sample I just did:
custom NSView named myView :
Next I set a window’s contentView an instance of myView. I did it in IB but you can manually set it via
setContentView.And I configured the window like this :
And this is what I get.
So like I said, you need to tell the window to use an invisible colour as background, then redraw the parts you actually do need drawn.