# Rect returned by Screen

**URL:** <https://psychtoolbox.discourse.group/t/rect-returned-by-screen/773>\
**Category:** Uncategorized\
**Created:** [June 22, 2010, 11:24pm UTC](https://psychtoolbox.discourse.group/t/rect-returned-by-screen/773 "2010-06-22T23:24:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [June 22, 2010, 11:24pm UTC](https://psychtoolbox.discourse.group/t/rect-returned-by-screen/773/1 "2010-06-22T23:24:03Z")

</div>

Having used PTB for years without ever encountering this issue, I'm   
wondering if I have missed something or am brain dead but ...  
  
The OpenWindow call to Screen returns a window pointer and a rect.  
  
[windowPtr,rect]=Screen('OpenWindow',windowPtrOrScreenNumber ...)  
  
Here is the paragraph of the documentation for the rect  
  
 "rect" argument: "rect" is a 1x4 matrix containing the upper left and  
 lower right coordinates of an imaginary box containing all the pixels.  
 [Irrelevant text deleted here]  
 Historically we've had two different orderings of the  
 elements of rect, so, for general compatibility, all of the Psychophysics  
 Toolbox refers to the elements symbolically, through RectLeft, RectTop, etc.  
 Since 2/97, we use Apple's standard ordering: RectLeft=1, RectTop=2,  
 RectRight=3, RectBottom=4.  
  
As I read the start of this paragraph, it says that the coordinates in the   
rect are ordered [upper left lower right] and that agrees with what I get   
when I run this on my system (running PTB 3.0.8). However, the end of the   
paragraph says that everything is standardized on the Apple standard with   
the ordering [left upper right lower]. So what this means is that the   
indices defined in PsychRects don't work with the rect returned by   
OpenWindow. Is this something that everyone else knows and I just missed? Is   
this really what's intended? The documentation certainly seems confusing to   
me at the very least.  
  
Ted Wright
