creating hyperlinks in an html.HtmlWindow

Hi all. Does anyone know how to make my hyperlinks that I use in an HtmlWindow widget open up using the user's default programs? For a website link, it opens it up in the HtmlWindow itself, which is not good for an About box!

For email it just doesn't work. It locks up for a while then says it can't find the address. Is there something I need to add to make this work normally, or does HtmlWindow not really support this?

Thanks.

John Salerno:

Hi all. Does anyone know how to make my hyperlinks that I use in an HtmlWindow widget open up using the user's default programs? For a website link, it opens it up in the HtmlWindow itself, which is not good for an About box!

For email it just doesn't work. It locks up for a while then says it can't find the address. Is there something I need to add to make this work normally, or does HtmlWindow not really support this?

Try adding target="_blank" to the anchor tag, i.e. <a href="http://whatever" target="_blank">Whatever</a>. Not sure whether it works for mailto urls, though.

Cheers, Frank

Or

import webbrowser
with the following method in your HtmlWindow class

    def OnLinkClicked(self, linkinfo):
        href = linkinfo.GetHref()
        webbrowser.open(href)
    # def OnLinkClicked - end

···

On 10/23/06, Frank Niessink <frank@niessink.com> wrote:

John Salerno:
> Hi all. Does anyone know how to make my hyperlinks that I use in an
> HtmlWindow widget open up using the user's default programs? For a
> website link, it opens it up in the HtmlWindow itself, which is not good
> for an About box!
>
> For email it just doesn't work. It locks up for a while then says it
> can't find the address. Is there something I need to add to make this
> work normally, or does HtmlWindow not really support this?

Try adding target="_blank" to the anchor tag, i.e. <a
href="http://whatever" target="_blank">Whatever</a>. Not sure whether it
works for mailto urls, though.

Cheers, Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--
Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com
OpenRPG+ Lead Developer
~~http://openrpg.digitalxero.net
XeroPortal Creator
~~http://www.digitalxero.net
Web Admin for Thewarcouncil.us
~~http://www.thewarcouncil.us

John Salerno wrote:

Hi all. Does anyone know how to make my hyperlinks that I use in an HtmlWindow widget open up using the user's default programs? For a website link, it opens it up in the HtmlWindow itself, which is not good for an About box!

For email it just doesn't work. It locks up for a while then says it can't find the address. Is there something I need to add to make this work normally, or does HtmlWindow not really support this?

Look at the demo. You need to override OnLinkClicked and then you can do whatever you want with the link click.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

John Salerno wrote:

Hi all. Does anyone know how to make my hyperlinks that I use in an HtmlWindow widget open up using the user's default programs? For a website link, it opens it up in the HtmlWindow itself, which is not good for an About box!

For email it just doesn't work. It locks up for a while then says it can't find the address. Is there something I need to add to make this work normally, or does HtmlWindow not really support this?

Look at the demo. You need to override OnLinkClicked and then you can do whatever you want with the link click.

Thanks guys!