wx.html中的超链接 - 如何在同一个html页面内导航
问题描述:
我已经在wxpython中使用wx.html创建了一个带有帮助菜单项的菜单。我用的是如下代码:wx.html中的超链接 - 如何在同一个html页面内导航
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())
我发现代码here
我想,当我在这些超链接之一点击进入到其他HTML类我已创建。
示例:单击在Python 2.4链接到HTML类名蟒蛇
我希望有人明白我想create..Thanks
答
那么,在OnLinkClicked方法,摆脱了网页浏览器的东西,并把你的自定义代码。我想你会想创建一些另外的HTML字符串,然后再次调用SetPage或者沿着这些行调用SetPage。或者你可以看看wxPython 2.9中的WebView的东西,它支持比HtmlWindow更多的LOT。
转到[这里](http://www.davesite.com/webstation/html/chap09.shtml)这个我想做的。 – TLSK 2012-03-22 21:54:21