I writing NPAPI
plugin with Firebreath
framework on Mac OSX.
I need create NSTextField in plugin window.
First, i try create NSWindow
with init
function
(NSWindow *)initWithWindowRef:(void *)carbonWindowRef
But WindowRef always null (i try get it after FB::CoreGraphicsDraw event)
void Plugin::onCoreGraphicsDraw(FB::CoreGraphicsDraw* evt, FB::PluginWindowMacCG* win)
{
WindowRef win_ref = win->getWindowRef();
}
win_ref always equal null.
How i can create NSTextField
another method?
What you are trying to do is impossible. Modern OS X plugin drawing systems do not give you a window; you need to either draw into a
CGContext
you are given, or vend aCALayer
, depending on which model you use.There's no way to use native controls in an OS X NPAPI plugin. If you want native controls on OS X, you need to build a stand-alone application, not a browser plugin.