【发布时间】:2021-05-22 18:40:55
【问题描述】:
我使用 wxpthon 库在 CentOS 系统 wx.html2 中编写 UI 程序。 WebView控件,提示如下错误:
File "main.py", line 143, in <module>
frame = DemoFrame()
File "main.py", line 101, in __init__
self._mainPanel = MainPanel( self )
File "main.py", line 17, in __init__
self.view = wx.html2.WebView.New(self)
NotImplementedError
我的部分代码是这样的:
class MainPanel( sp.ScrolledPanel ):
#Main Panel
def __init__( self, parent ):
sp.ScrolledPanel.__init__( self, parent=parent )
self.SetupScrolling()
self.view = wx.html2.WebView.New(self)
self.view.LoadURL( "http://www.baidu.com" )
CentOS 版本:CentOS Linux release 8.2.2004 (Core)
Python 版本:Python 3.6.8
wxPython 版本:4.1.1 gtk3 (phoenix) wxWidgets 3.1.5
【问题讨论】:
-
您确定要单独导入吗?即
import wx.html2 -
是的,我确定。我一直在写mswin平台类似的应用程序,我查询了相关资料,默认,centos系统安装了火狐浏览器,火狐浏览器基于Gecko内核代码,和wxPython 网站似乎没有提到 wx。 html2。 WebView对内核的支持,所以我可能需要自己编译WebKitGTK+,以满足其内核调用的模块,当然这只是我的猜测,没有经过验证。
标签: python webview wxpython centos8 wx.html2