title: NSOpenGLView resize on window resize
body: <p>I have a class called ModelView which inherits from NSOpenGLView. 
  When my program runs i attach the ModelView as follows to the main window.</p>
  
  <pre><code>- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
      // Insert code here to initialize your application 
      ModelView *glView; 
      NSRect glViewRect = CGRectMake(0.0f, 0.0f, window.frame.size.width, window.frame.size.height);
      glView = [[ModelView alloc] initWithFrame: glViewRect];
      [[window contentView] addSubview:glView];           
  }
  </code></pre>
  
  <p>In my ModelView class i have a reshape function which is firing every time the window resizes </p>
  
  <pre><code>- (void)reshape
  {
      [super setNeedsDisplay:YES];
      [[self openGLContext] update];  
      NSLog(@"reshap function called");
  }
  </code></pre>
  
  <p>I want to get the main window width so i can resize the ModelView but i cant find how to get the window width from the ModelView class</p>
  
  <p>I am reasonably new to cocoa/objective-c so any help is appreciated</p>