开发者

Macintosh Application location in case of dual monitor

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜