问题描述
众所周知,我们可以显示带有html元素的输入框.像这样.< \ input type ="text" name =" value =">.但现在我想在Safari中使用NPAPI插件显示此输入框.当我嵌入此插件时,该框应显示在safari中.我在中找到了一个名为"NPAPI核心动画电影插件"的npapi示例. https://developer.apple.com/library/archive/samplecode/NPAPI_Core_Animation_Movie_Plugin/Introduction/Intro.html .在此示例中,它绘制了将在野生动物园中显示的所有内容.但是我想知道是否可以使用NSTextField直接显示输入框.有人做过类似的工作吗?
As we all know, we can show input box with html element.like this.<\input type="text" name="" value="" >. but now I want to display this input box on safari with NPAPI plugin.when I embed this plugin the box should show on safari. I found a npapi sample named "NPAPI Core Animation Movie Plugin" in https://developer.apple.com/library/archive/samplecode/NPAPI_Core_Animation_Movie_Plugin/Introduction/Intro.html . In this sample, it draws anything that will show on safari. But I want to know whether it is possible to use NSTextField to show a input box directly. Have anyone done the similar work?
推荐答案
您不能在OS X的NPAPI中使用NSTextField或其他本机控件.NPAPI并非旨在将本机控件嵌入到浏览器的窗口中.
You cannot use NSTextField, or other native controls, in NPAPI on OS X. NPAPI is not designed for embedding native controls into a browser's window.
这篇关于如何使用NPAPI插件在野生动物园上显示输入框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!