Reputation: 504
I have two NSWindow
s, one of which is the child of the other. Basically what I want to accomplish is for the child to pop out and appear to extend the parent. If you like, think of it as opening a book: the cover flips out and ends up at the same Z order as the title page.
However I have the problem that one of the windows is always casting a shadow on the other. Is there any way to have them be on the same Z, so that neither casts a shadow on the other, but both cast shadows on windows below them?
Upvotes: 0
Views: 424
Reputation: 1486
Could this work? Take your existing child window, and remove the shadow with a setShadow:false call. Meanwhile create a third dummy window Z-ordered behind the two existing windows. Make it so that this window is always the same size and shape as the true child window and leave the shadow on.
Two possible problems with this: (1) a weird 'double shadow' at the point(s) where the two shadows intersect. (2) The shadow that the window with the focus casts is much larger than the shadow that windows without the focus cast. So if focus shifts between your two windows, the shadow might change size. Not sure how you'd get around that problem.
Otherwise your only choice may be to put both your windows with shadows turned off in a yucky container window which casts the one shadow. This would be a pretty radical UI change, but in my experience apps that tinker with the default appearance of their application's 'outer edge' or try to code their own partial transparency without using OS features rarely run smoothly.
Upvotes: 1