开发者

Macintosh Application location in case of dual monitor

开发者 https://www.devze.com 2023-02-20 10:04 出处:网络
Suppose my Macintosh machine ha开发者_如何学Cs dual monitors how can I accurately determine the monitor in which my application is in.[NSScreen mainScreen] returns the screen with the focused window.

Suppose my Macintosh machine ha开发者_如何学Cs dual monitors how can I accurately determine the monitor in which my application is in.


[NSScreen mainScreen] returns the screen with the focused window. Call this method while you're application is activated


Call -[NSWindow screen] on the window you're interested in, e.g. your main window (keep in mind that if you have several windows each of them may be on a different screen).

0

精彩评论

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