Reputation: 30558
I am writing an OS X application. I would like to find a NSView position on the whole screen. How can I find that position. I don't want this position related to the NSWindow, but the position on the whole screen. Is this possible to do so? Or I need to use NSWindow's location information to find that? Thanks.
Upvotes: 5
Views: 3309
Reputation: 2960
You can use NSWindow
’s method -convertRectToScreen:
to convert the rectangle to the screen coordinate system from the window’s coordinate system.
NSRect rectInScreen = [self.view.window convertRectToScreen:self.view.frame];
Upvotes: 10