Hi Robin,
I’m still a new user apparently, so I had to create a new topic. I have some example code illustrating my issue described in this topic.
It turns out the issue happens when using Edge in Notebook pages other than the first. In my code below, if you chagne the backend to IE, it works fine. I’ve also tried combinations where there is only one webview, and that fails with Edge if it is not in the first Notebook page.
- Windows7
- Edge Version 87.0.664.30 (Official build) beta (64-bit)
- wxPython4.1.1a1.dev5044+6959fd7f-cp37-cp37m-win32.whl
Unfotunately, I don’t have a Windows 10 machine to try it on now. But this strikes me as unrelated to the OS?
import wx
import wx.html2 as webview
class DVHAMainFrame(wx.Frame):
def __init__(self, *args, **kwds):
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.notebook_main_view = wx.Notebook(self, wx.ID_ANY)
self.tab_keys = ['Browser 1', 'Browser 2']
self.notebook_tab = {key: wx.Panel(self.notebook_main_view, wx.ID_ANY) for key in self.tab_keys}
self.plot = {key: webview.WebView.New(self.notebook_tab[key], backend=webview.WebViewBackendEdge) for key in self.tab_keys}
for plot in self.plot.values():
plot.LoadURL("http://www.google.com")
notebook_sizers = {key: wx.BoxSizer(wx.VERTICAL) for key in self.tab_keys}
for key, notebook_tab in self.notebook_tab.items():
notebook_sizers[key].Add(self.plot[key], 1, wx.EXPAND, 0)
notebook_tab.SetSizer(notebook_sizers[key])
self.notebook_main_view.AddPage(self.notebook_tab[key], key)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.notebook_main_view, 1, wx.EXPAND, 0)
self.SetSizer(sizer)
self.Layout()
self.Center()
class MainApp(wx.App):
def OnInit(self):
self.SetAppName('DVH Analytics')
self.frame = DVHAMainFrame(None, wx.ID_ANY, "")
self.SetTopWindow(self.frame)
self.frame.Show()
return True
def start():
app = MainApp()
app.MainLoop()
if __name__ == "__main__":
start()