I know this has been discussed before, but I couldn't concoct the
necessary google incantation to dig it up...I use wx.html.HtmlWindow to quickly produce formatted information. I
would like to be able to create anchor tags <a href="..."> some anchor
</a>, that were '"application specific". That is, instead of loading
a URL, I want my application to "capture" the click and behave
appropriately. It would be analogous to handling an event.
I think the wxPython 2.5.2 demo has this.
Inherit the class, and override:
def OnLinkClicked(self, linkinfo):
self.log.WriteText('OnLinkClicked: %s\n' % linkinfo.GetHref())
# Virtuals in the base class have been renamed with base_ on the front.
self.base_OnLinkClicked(linkinfo)
And the linkinfo contains the href info.
Best regards.
ZhangYue张岳
zhangyue99@tsinghua.org.cn
2004-10-11