Firebreath mac os x create NSTextField in plugin window

120 views Asked by At

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?

1

There are 1 answers

0
smorgan On

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 a CALayer, 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.