title: NSWindow setFrame | setPosition on the screen
body: <p>In my application, I need to display a multiple window of same NIB, at a time, and it will be closed/released on the timer basis, </p>
  
  <p>everything is working fine, except the window position. My requirement is, it should display the window exactly below the previous window, I am able to calculate origin for the new window if any window of same NIB is present.</p>
  
  <p>I am using this function to get the origin:  </p>
  
  <pre><code>-(void)awakeFromNib{  
  
      NSString *eventMsg = [NSString stringWithFormat:@"%s is set “,eventName];  
      [pTextField setStringValue:eventMsg];
  
      [pWindow setFrameOrigin:[self pointstoDisplayScreen]];
  
      /* On timer callback , i will show the fadeout and fadein effects*/
      [self startTimer];
  }     
  
  /* This method returns the coordinate where to 
     draw the window 
   */
  -(NSPoint)pointstoDisplayScreen{
      NSRect frame = [[NSScreen mainScreen] visibleFrame];
      NSRect windowRect = [pWindow frame];
  
      CGFloat yCoordinate = frame.size.height-windowRect.size.height;
  
      NSPoint point = NSMakePoint(frame.size.width - windowRect.size.width, frame.size.height-windowRect.size.height);
  
      /* Let there be some gap, if any window present and let it draw below to 
         the existing window 
       */
      point.y -=  (windowRect.size.height + windowOffset)*noOfWindow;
      NSLog([NSString stringWithFormat:@"PositionToDisplayScreen x = [%f] y = [%f]",point.x,point.y ]);
  
      return point;
  }
  </code></pre>
  
  <p>The problem is if if previous window is present it draws the new point, slightly below and toward right side of the existing window,   </p>
  
  <p>Is there any property i need set, the problem is, if the previous position is exactly on the top right, then it draw the new window on the opposite corner.</p>