我可以使用窗口内的对象来移动窗口吗?
在 Cocoa 中是否可以通过拖动窗口内的对象来移动窗口? 例如:我在窗口内有一个 webview,与窗口一样大,所以 setMovableByWindowBackground 显然不起作用。有没有办法单击并拖动网络视图并移动整个窗口?
Is it possible in Cocoa to move a window by dragging an object which is inside that window?
For example: I have a webview inside a window, big as the window, so setMovableByWindowBackground will obviously not work. Is there a way to click and drag the web view and move the whole window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,您只需使用
mouseDragged
来跟踪鼠标移动即可。与此类似的东西应该有效:我从这里得到的: http://www.cocoadev.com/ index.pl?SetMovableByWindowBackground
Sure, you've just got to track the mouse movements using
mouseDragged
. Something similar to this should work:Which I got from here: http://www.cocoadev.com/index.pl?SetMovableByWindowBackground