Johan_
Johan_

Reputation: 440

Is it possible to display a NSWindow on a CALayer?

I'm provided with a CALayer* and would like to know if it's possible to dynamically create a NSWindow and show it on the layer?

Thanks in advance!

Upvotes: 2

Views: 629

Answers (1)

Peter Hosey
Peter Hosey

Reputation: 96323

I'm provided with a CALayer* and would like to know if it's possible to dynamically create a NSWindow …

Yes.

… and show it on the layer?

Nope.

You can make a layer that knows about the window or its content view and, when told to draw, tells the window's content view to draw, or you could take a screenshot of the window and set it as the layer's contents. But you can't put a window into a layer.

Upvotes: 4

Related Questions