自定义 NSWindow 绘图
我想绘制一个自定义 NSWindow,它允许我甚至在顶栏顶部(交通灯按钮和标题栏所在的位置)添加子视图。
当我使用透明窗口并使用自定义视图来模仿 NSWindow 时,我需要自己实现很多事情,因此我认为应该有更好的方法来实现这一点。
I want to draw a custom NSWindow that allows me to add subviews even on top of the top bar ( where the traffic light buttons are and the title bar ).
When I use a transparent window and use a custom view to mimic a NSWindow I need to implement so many things by myself that I thought there should be a better way of achieving this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Apple 有两个自定义窗口示例项目: RoundTransparentWindow 和 FunkyOverlayWindow(不过这个旧!)。 Cocoa With Love 有一篇教程文章,请务必阅读底部链接的有关窗框中自定义绘图的文章。
Apple has two custom window sample projects: RoundTransparentWindow and FunkyOverlayWindow (this one is old, though!). Cocoa With Love has an tutorial article, and be sure to read the article linked at the bottom, about custom drawing in window frames.
要解决这个问题,只需给它正确的框架来定位它即可。
Does the trick, simply give it the rgiht frame to position it.
@antwan 查看 github 上关于 INAppStoreWindow 的讨论 https://github.com/indragiek/INAppStoreWindow/issues /169
@antwan Check out the discussion on github for INAppStoreWindow https://github.com/indragiek/INAppStoreWindow/issues/169