I have a project set up as a notebook layout using wxpython. I am trying to create a help panel. The HtmlWindow object doesn't display the html page on the panel. No errors are displayed and a call to HtmlWindow.GetOpenedPage() returns the page name.
import wx
import wx.html as html
class HelpPanel(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, parent, id)
self.panel = wx.Panel(self, -1)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.help = html.HtmlWindow(self.panel, -1, style=wx.NO_BORDER)
self.help.LoadFile('help.html')
self.sizer.Add(self.help)
self.panel.SetSizer(self.sizer)
self.Show(True)
def add_help_panel(self, parent, evt):
self.help_panel = HelpPanel(parent, -1)
parent.AddPage(self.help_panel, 'Help')
parent.SetSelection(parent.GetPageCount()-1)
Here is the call from the menu to open the HelpPanel:
wx.EVT_MENU(self, ID_HELP, lambda evt: help.HelpPanel.add_help_panel(help.HelpPanel(self.nb, -1), self.nb, evt))