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

Discussion in 'Python' started by iambus@gmail.com, Sep 6, 2006.

  1. Guest

    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:"></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 "" 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:. What should I do to solve this problem?

    (My OS is WinXP.)

    Thanks.
     
    , Sep 6, 2006
    #1
    1. Advertising

  2. Guest

    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
     
    , Sep 6, 2006
    #2
    1. Advertising

  3. Gerold Penz Guest

    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("mailto:?subject=Hello&body=World")


    regards,
    Gerold
    :)


    --
    ________________________________________________________________________
    Gerold Penz - bcom - Programmierung
    | http://gerold.bcom.at | http://sw3.at
    Ehrliche, herzliche Begeisterung ist einer der
    wirksamsten Erfolgsfaktoren. Dale Carnegie
     
    Gerold Penz, Sep 6, 2006
    #3
  4. Guest

    Thanks. It works now.

    --Kneo

    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:"></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 "" 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:. What should I do to solve this problem?
    >
    > (My OS is WinXP.)
    >
    > Thanks.
     
    , Sep 10, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Kelley

    How to insert into listbox using wxPython

    Brian Kelley, Jan 8, 2004, in forum: Python
    Replies:
    5
    Views:
    7,995
    David Bolen
    Jan 12, 2004
  2. Replies:
    6
    Views:
    618
    Jorgen Bodde
    Apr 11, 2007
  3. Boštjan Mejak

    HTMLWindow or HtmlWindow or perhaps HTMLwindo

    Boštjan Mejak, Nov 15, 2010, in forum: Python
    Replies:
    2
    Views:
    228
    Krister Svanlund
    Nov 15, 2010
  4. Blue®
    Replies:
    4
    Views:
    915
    Blue®
    Sep 27, 2003
  5. Sergio del Amo
    Replies:
    4
    Views:
    267
Loading...

Share This Page