Dear friends,
I'm having a strange issue with a simple python code involving wx and HTML2.
It is a code to run a local html page (on windows) but when I close the browser, the process stays in memory and I have to manually kill it.
Here is the code, I hope you can help me.
import wx
import wx.html2, os
class MyBrowser(wx.Dialog):
def __init__(self, *args, **kwds):
wx.Dialog.__init__(self, *args, style=wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX)
sizer = wx.BoxSizer(wx.VERTICAL)
self.browser = wx.html2.WebView.New(self)
sizer.Add(self.browser, 1, wx.EXPAND, 10)
self.SetSizer(sizer)
self.SetSize((800, 700))
self.SetTitle("GetZ")
if __name__ == '__main__':
app = wx.App()
dialog = MyBrowser(None, -1)
dialog.browser.LoadURL("file:///"+os.getcwd()+"/GetZ.htm")
dialog.Show()
app.MainLoop()
Thanks for your help,
Gianluca