“耦合” NSWindows
我正在尝试“耦合”NSWindows。
我的意思是 2 个大小相同、并排放置的 NSWindows。如果我移动一个,另一个也必须移动以保持两者并排。
我尝试对子窗口执行此操作,但是当移动子窗口时,“母亲”保持在原位。
我怎样才能得到这种行为?
I am trying to have "coupled" NSWindows.
I mean 2 NSWindows of the same size, positioned side by side. If I move one, the other one has to move as well to keep both side by side.
I tried to do this with child window but when the child window is moved, the "mother" stays in place.
How I can get this behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将一个对象指定为窗口委托并响应
-windowDidMove:
、-windowWillResize:toSize:
和/或-windowWillMove:
委托方法,或注册接收相应通知。然后,您可以根据需要调整另一个窗口的大小。顺便说一句,这听起来像是一个奇怪的用户界面。不能只使用分割视图吗?
Designate an object as the windows' delegate and respond to the
‑windowDidMove:
,‑windowWillResize:toSize:
and/or‑windowWillMove:
delegate methods, or register to receive the corresponding notifications. You can then resize the other window as you see fit.This sounds like an odd UI, by the way. Can you not just use a split view?