title: Resizing NSView / NSOpenGLView on window resize
body: <p>I currently have a mac application with the window size on opening set at 480 x 560, within this window there is an <code>NSOpenGLView</code>, in the reshape function for this I have the following:</p>
  
  <pre><code>NSLog(@"Reshaping");
  float screenWidth = (float)[_window frame].size.width;
  float screenHeight = (float)[_window frame].size.height;
  glLoadIdentity();
  glViewport(0,0,screenWidth,screenHeight);
  glMatrixMode(GL_PROJECTION);
  glOrtho(-10, 110, -10, 110, -1, 1);
  </code></pre>
  
  <p>This all seems to work fine from the OpenGL side with the image stretching etc but when I make the window larger than it originally was the OpenGL view doesn't seem to want to change (however the OpenGL within it does). I printed the following values out to see what was wrong:</p>
  
  <pre><code>NSLog(@"width 1:",[_window frame].size.width);
  NSLog(@"width 2:",[self bounds].size.width);
  NSLog(@"width 3:",[[self superview] bounds].size.width);
  </code></pre>
  
  <p>And the only one which changes is the first one, can the other two be updated manually (I tried setting them to the window frame values but these are read only..) or am I missing something here?</p>