XnavxeMiyyep
Jan 18, 2009, 09:21 PM
NSRect frameRect;
....
for(int i = 0; i < scns; i ++){
frameRect = [[[NSScreen screens] objectAtIndex:i] frame];
NSLog(@"Checking screen %i: %f %f %f %f",i,frameRect.origin.x,frameRect.origin.y,frameRect.origin.x+frameRect.size.width,frameRect.origin.y+ frameRect.size.height);
...
}
Checking screen 0: 0.000000 0.000000 1600.000000 1200.000000
...
Checking screen 1: -1680.000000 150.000000 0.000000 1200.000000
The coordinates assume that my screens are aligned at the bottom, which is not the case; they are aligned at the top, so screen 1 should be -1680, 0, 0, 1050.
I suppose it wouldn't be a problem, except that my program interacts with AppleScript, which actually gets the proper coordinates. I can't just put a 150 pixel vertical offset (which is, of course, the difference in heights of the monitors), because I want to ultimately produce a real program. :(
Am I missing something? Is there an alternative to NSScreen? I'm so close to finishing this project, but I can't make any sense out of this. :confused:
....
for(int i = 0; i < scns; i ++){
frameRect = [[[NSScreen screens] objectAtIndex:i] frame];
NSLog(@"Checking screen %i: %f %f %f %f",i,frameRect.origin.x,frameRect.origin.y,frameRect.origin.x+frameRect.size.width,frameRect.origin.y+ frameRect.size.height);
...
}
Checking screen 0: 0.000000 0.000000 1600.000000 1200.000000
...
Checking screen 1: -1680.000000 150.000000 0.000000 1200.000000
The coordinates assume that my screens are aligned at the bottom, which is not the case; they are aligned at the top, so screen 1 should be -1680, 0, 0, 1050.
I suppose it wouldn't be a problem, except that my program interacts with AppleScript, which actually gets the proper coordinates. I can't just put a 150 pixel vertical offset (which is, of course, the difference in heights of the monitors), because I want to ultimately produce a real program. :(
Am I missing something? Is there an alternative to NSScreen? I'm so close to finishing this project, but I can't make any sense out of this. :confused:
