开发者

Display NSWindow as Subview of NSView

开发者 https://www.devze.com 2022-12-30 01:20 出处:网络
I have an NSWindow that I want to display as part of another window. It has to be an NSWindow; I don\'t want to chang开发者_JAVA百科e it to an NSView or anything... I just don\'t because it involves a

I have an NSWindow that I want to display as part of another window. It has to be an NSWindow; I don't want to chang开发者_JAVA百科e it to an NSView or anything... I just don't because it involves accessing foreign nib files and the such.

How should I accomplish this if possible? I was thinking along the lines of grabbing the view of the NSWindow and sticking it as the subview of another view in my main window... but I don't think this is possible. Is it?


If you're okay with the window as-is, just add it as a child window to the window in your own app. That will handle positioning and everything, although you might have to patch up the responder chain and such to really get things working properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号