1

I have create in wxpython a menu with a help menuitem,using wx.html. I use the follow code:

    class AboutDlg(wx.Frame):


        def __init__(self, parent):

            wx.Frame.__init__(self, parent, wx.ID_ANY, title="About", size=(400,400))

            html = wxHTML(self)

            html.SetPage(
            ''

            "<h2>About the About Tutorial</h2>"

            "<p>This about box is for demo purposes only. It was created in June 2006"

            "by Mike Driscoll.</p>"

            "<p><b>Software used in making this demo:</h3></p>"

            '<p><b><a href="http://www.python.org">Python 2.4</a></b></p>'

            '<p><b><a href="http://www.wxpython.org">wxPython 2.8</a></b></p>'
                        )

    class wxHTML(wx.html.HtmlWindow):
        def OnLinkClicked(self, link):
            webbrowser.open(link.GetHref())

I find the code here

I want when i click in one of those hyperlinks to go to an other html class i have create.

Example:Click in Python 2.4 link go to html class with name python

I hope someone understand what i want to create..Thanks

TLSK
  • 275
  • 1
  • 6
  • 25
  • Go [here](http://www.davesite.com/webstation/html/chap09.shtml) this i want to make. – TLSK Mar 22 '12 at 21:54

1 Answers1

1

Well, in the OnLinkClicked method, get rid of the webbrowser stuff and put in your custom code. I think you'll want to just create some another string of HTML and then call SetPage again or something along those lines. Or you could look at the WebView stuff in wxPython 2.9 which supports a LOT more than HtmlWindow ever will.

Mike Driscoll
  • 32,629
  • 8
  • 45
  • 88