title: Center programmatically created window
body: <p>I've been using the example from here to create a custom titlebar-less window:</p>
  <p><a href="http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html" rel="nofollow noreferrer">Drawing a custom window on Mac OS X</a></p>
  <p>I've found this is the only way i can create a titlebar-less window in Leopard, Snow Leopard and Lion, other methods don't work right either on Leopard or Lion.
  (If i try to invoke a titlebar-less window via normal NSWindow and IB, it won't start up in Leopard anymore)</p>
  <p>So far this custom titlebar-less window works great everywhere, but i can't center it, only a hard fixed position in Interface Builder.</p>
  <p>It's fairly easy to center a normal NSWindow *window implementation with [window center], but i've found nothing that works on this custom window subclass, a window that isn't created from nib via Interface Builder.</p>
  <p>I've tried a few things from <a href="https://developer.apple.com/documentation/appkit/nswindow" rel="nofollow noreferrer">NSWindow</a>, but nothing seems to work.</p>
  <p>Any Ideas?</p>