Move the setting of the emulation level to before the WebView is created. Add note about resetting it to default.

This commit is contained in:
Robin Dunn
2019-06-10 20:58:26 -07:00
parent f9d642d6d1
commit b5b6f04fbc

View File

@@ -17,8 +17,14 @@ class TestPanel(wx.Panel):
sizer = wx.BoxSizer(wx.VERTICAL)
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
webview.WebView.MSWSetEmulationLevel(webview.WEBVIEWIE_EMU_IE11)
self.wv = webview.WebView.New(self)
webview.WebView.MSWSetEmulationLevel(level=webview.WEBVIEWIE_EMU_IE11)
# The emulation level is a persistent per-user per-application value. If
# you would like to reset it back to the default (no-emulation) then
# it can be done by calling this:
webview.WebView.MSWSetEmulationLevel(webview.WEBVIEWIE_EMU_DEFAULT)
self.Bind(webview.EVT_WEBVIEW_NAVIGATING, self.OnWebViewNavigating, self.wv)
self.Bind(webview.EVT_WEBVIEW_LOADED, self.OnWebViewLoaded, self.wv)