title: How to create a window in browser which has a NSWindow handle?
body: <p>I am making a plugin for safari on mac. I am stuck at how to create a window over browser's window upon which a video can be displayed.</p>
  
  <p>Earlier, we were using Cocoa Event model under which window pointer received in <code>NPWindow</code> in <code>NPP_SetWindow</code> function is null. Then we switched to Carbon Event model and we got pointer to <code>NP_CGContext</code> via window pointer present in NPWindow struct, using which we got pointer to WindowRef and got a pointer to NSWindow as following:</p>
  
  <pre><code>NP_CGContext* npContext = (NP_CGContext*)npWindow-&gt;window;
  WindowRef window = npContext-&gt;window;
  NSWindow* browserWindow = [[[NSWindow alloc] initWithWindowRef:window] autorelease];
  </code></pre>
  
  <p>Our streaming engine accepts the pointer to <code>NSWindow</code>. We don't know how to create a window in our browser space.</p>
  
  <p>So any help regarding the window creation would be appreciated.</p>