检测Mac OS X窗口何时调整大小或移动 [英] Detect when a Mac OS X window is resized or moved

查看:88
本文介绍了检测Mac OS X窗口何时调整大小或移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个应用程序,必须知道什么时候调整窗口大小或移动。
我看过通知,但似乎它不按照我的预期。

I am writing an application which must know when any window is resized or moved. I have looked at notifications but it seems it does not do what I expected.

你有什么想法如何实现这一点?

Do you have any idea how I can achieve this?

推荐答案

给你的窗口一个委托。 NSWindowDelegate协议具有 windowWillResize:toSize: windowWillMove:方法。

Give your window a delegate. The NSWindowDelegate protocol has windowWillResize:toSize: and windowWillMove: methods.

这篇关于检测Mac OS X窗口何时调整大小或移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆