Reputation: 1484
I have a borderless NSWindow that I'm adding as a child window to the main window of the app. In a particular mode the child window may lie partially outside the frame of the parent window then it zooms forward so it is completely enclosed.
If the main window is not full screen, then it looks odd for the child window to be drawn outside the main Window. Is it possible to clip it?
Upvotes: 4
Views: 757
Reputation: 4433
No, I don’t think so. On OS X, windows (and thereby NSWindow
s) are composited by the window server, and have their own buffers. They’re essentially OpenGL quads and the drawing is done into a texture (that is a simplification, but it’s basically how it works).
You don’t explain in your question why you’re using a child window (as opposed to, for instance, a layer-backed view, or even just a plain NSView
); often, you can avoid using child windows at all, which would seem to be the most straightforward solution to your problem in this instance.
(Note, if you’re coming from a Windows background, that Cocoa expects you to use views rather than windows for most purposes; in a typical application you only need to use windows at the top level of your interface hierarchy.)
Upvotes: 1