HtmlHelpController.Initialize won't work

I am toying with wx.html.HtmlHelpController and I just found out that “Initialize” doesn’t work at all…

class MainFrame(wx.Frame): 
    def __init__(self, *args, **kwargs):
        wx.Frame.__init__(self, *args, **kwargs)
        self.Bind(wx.EVT_HELP, self.on_help)

    def on_help(self, event): # just press "F1" to see the help window

class MyApp(wx.App):
    def OnInit(self):
        self.help_controller = wx.html.HtmlHelpController()
        self.help_controller.Initialize('')  # this won't work
        # self.help_controller.AddBook('')   # this works fine
        return True


If you need a zip file to try this snippet, you may use the “” documentation sample from the wxWidgets repo:

Now, if you try the “Initialize” API, it doesn’t load the docs into the help window. But, if you try “AddBook” instead, everything works as expected.
This seems a bit funny because “Initialize” will just end up calling “AddBook” anyways… see

I have a little hesitation in opening a ticket at wxWidgets’, because it seems very odd that nobody noticed such an obvious bug in a code that is now 20 years old… I think I am missing something here…

Could someone please test and confirm this for me? (I’m running the latest nightly build of wxPython on my windows box, but it should be platform-independent…)
Thanks a lot

It looks like it is a problem in wxPython, due to not letting SIP know about the implementation of Initialize in the subclasses. I’ll get a fix started.

Oh wow… I never guessed it was a wxPython issue. Uhm, I guess this whole “could you please just add HelpController” business turned out to be a bit of a rabbit hole… sorry for the trouble!
I’ll wait for the next built then… thanks again!

No worries. It’s always good to identify and resolve issues.