How to insert an email-link into wxPython's HtmlWindow

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • iambus@gmail.com

    How to insert an email-link into wxPython's HtmlWindow

    Hello. I don't know if this topic is appropriate in this group (and my
    English is not good).

    My problem is here:

    I created a HtmlWindow in wxPython, then I wrote some code and set it
    to the page-text. In these code there was a line "<a
    href="mailto:na me@gmail.com">n ame@gmail.com</a>" (where "name" was my
    real username). Then I showed this HtmlWindow and I thought there would
    be a mail-sending box when I clicked on the "name@gmail.com " link (like
    when I clicked it in a web browser). But there just came a "Python
    Error"-titled dialog: Unable to open requested HTML document
    mailto:name@gma il.com. What should I do to solve this problem?

    (My OS is WinXP.)

    Thanks.

  • NoelByron@gmx.net

    #2
    Re: How to insert an email-link into wxPython's HtmlWindow

    Override OnLinkClicked() and check the passed link info for the 'mail:'
    prefix. And if its there, don't call the OnLinkClicked() method of the
    base class, to prevent wxWidgets from loading this link as a HTML
    ressource.

    Now, you have reduced your problem to: how do I call the standard Email
    client? I have no idea...


    Have fun,
    Noel

    Comment

    • Gerold Penz

      #3
      Re: How to insert an email-link into wxPython's HtmlWindow

      NoelByron@gmx.n et schrieb:
      Now, you have reduced your problem to: how do I call the standard Email
      client? I have no idea...
      Hi!

      With Windows, you can use ``os.startfile( )``:

      import os
      os.startfile("m ailto:hello@wor ld.at?subject=H ello&body=World ")


      regards,
      Gerold
      :-)


      --
      _______________ _______________ _______________ _______________ ____________
      Gerold Penz - bcom - Programmierung
      gerold.penz@tir ol.utanet.at | http://gerold.bcom.at | http://sw3.at
      Ehrliche, herzliche Begeisterung ist einer der
      wirksamsten Erfolgsfaktoren . Dale Carnegie

      Comment

      • iambus@gmail.com

        #4
        Re: How to insert an email-link into wxPython's HtmlWindow


        Thanks. It works now.

        --Kneo

        iambus@gmail.co m wrote:
        Hello. I don't know if this topic is appropriate in this group (and my
        English is not good).
        >
        My problem is here:
        >
        I created a HtmlWindow in wxPython, then I wrote some code and set it
        to the page-text. In these code there was a line "<a
        href="mailto:na me@gmail.com">n ame@gmail.com</a>" (where "name" was my
        real username). Then I showed this HtmlWindow and I thought there would
        be a mail-sending box when I clicked on the "name@gmail.com " link (like
        when I clicked it in a web browser). But there just came a "Python
        Error"-titled dialog: Unable to open requested HTML document
        mailto:name@gma il.com. What should I do to solve this problem?
        >
        (My OS is WinXP.)
        >
        Thanks.

        Comment

        Working...