title: How can I make a custom NSWindow subclass into a custom NSPanel?
body: <p>I'm using a very complex custom subclass of NSWindow called <code>MyWindow</code>. Now I want to make a new class called <code>MyPanel</code> which has the same behavior as NSPanel, but which inherits from <code>MyWindow</code> as it's superclass. I've read the <a href="https://developer.apple.com/library/mac/documentation/cocoa/Conceptual/WinPanel/Concepts/UsingPanels.html" rel="nofollow">official docs</a> for <code>NSPanel</code> but it doesn't say how to make a panel from custom NSWindow subclasses. My current code:</p>
  
  <p>MyPanel.h</p>
  
  <pre><code>#import "MyWindow.h"
  
  @interface MyPanel : MyWindow
  
  - (BOOL)isFloatingPanel;
  - (void)setFloatingPanel:(BOOL)flag;
  - (BOOL)becomesKeyOnlyIfNeeded;
  - (void)setBecomesKeyOnlyIfNeeded:(BOOL)flag;
  - (BOOL)worksWhenModal;
  - (void)setWorksWhenModal:(BOOL)flag;
  
  @end
  </code></pre>
  
  <p>MyPanel.m</p>
  
  <pre><code>#import "MyPanel.h"
  
  @implementation MyPanel
  
  @end
  </code></pre>
  
  <p>So now how can I accomplish this without directly subclassing <code>NSPanel</code> (which would mean I'd have to copy and paste all the code from <code>MyWindow</code> to <code>MyPanel</code>)? What methods, delegates, properties do I have to recreate/implement to get the same behavior as an NSPanel?</p>