title: NSButton not locked
body: <p>I'm trying to make an <code>NSView</code> programmatically and I'm a tad stuck. I don't usually do GUI programming and this is my first time trying to create a view. Everything is fine until I try to resize the window. The button doesn't stay 'pinned' in the position. It keeps moving around in the view. My code is below:</p>
  
  <pre><code>-(void) awakeFromNib
  {
  NSView *test=[[NSView alloc] initWithFrame:windowRect];
  button=[[NSButton alloc]initWithFrame:NSMakeRect(window.frame.origin.x-10.0, 
  window.frame.origin.y+50.0, 80.0, 50.0)];
  [button setBezelStyle:NSRoundedBezelStyle];
  window.title=@"window Test";
  [button setTitle:@"click me"];
  [button needsDisplay];
  [test addSubview:button];
  [[window contentView] addSubview:test];
  [window makeKeyAndOrderFront:nil];
  [[window contentView] setAutoresizesSubviews:YES];
  }
  </code></pre>
  
  <p>The button object is just a regular <code>NSButton</code>. </p>