I have an HTML window as an about window, and I placed "mailto:jasonc@gentex.com" into it. It shows up as a link and I can click
on it, but it tries to open as a web page. I am not suave enough yet to get
it to open the default e-mail program (Win98) with the e-mail address
inserted into the too position. If there is some example code or if you
could please point me in the correct direction with what command and/or docs
I would highly appreciate it.
Well, this example code is not quite what you want, but I hope that it's
useful... (it merely opens an external _browser_... however, I wouldn't be
too surprised if it'll work also for mailto links...)
(In a subclass of wxHtmlWindow...Otherwise [i.e. if in a subclass of another
window which is to contain a wxHtmlWindow called "html"], with code like
self.html = wxHtmlWindow(self, -1)
self.html.OnLinkClicked = self.OnLinkClicked
)
def OnLinkClicked(self,link):
if __debug__:
import Errors;Errors.InformationalMessagesWindow(
"%s.OnLinkClicked(): link: %s\n"
% (self,link))
self.link = wxTextDataObject(link.GetHref())
if link.GetEvent().ShiftDown():
if wxTheClipboard.Open():
wxTheClipboard.SetData(self.link)
wxTheClipboard.Close()
else:
import Errors;Errors.InformationalMessagesWindow (
"Couldn't open clipboard!\n")
else:
os.system ("start \"%s\"" % self.link.GetText ())
Please replace the "import Errors" lines with whatever you like...
Cheerio, Chris
···
-----Original Message-----
From: wxpython-users-admin@wxwindows.org
[mailto:wxpython-users-admin@wxwindows.org]On Behalf Of Conklin, Jason
Sent: Wednesday, 23 August 2000 2:51 AM
To: 'wxPython Mailing List'
Subject: [wxPython] HTML page question
I have an HTML window as an about window, and I placed
"mailto:jasonc@gentex.com" into it. It shows up as a link and I can click
on it, but it tries to open as a web page. I am not suave enough
yet to get
it to open the default e-mail program (Win98) with the e-mail address
inserted into the too position. If there is some example code or if you
could please point me in the correct direction with what command
and/or docs
I would highly appreciate it.
Well, this example code is not quite what you want, but I hope that it's
useful... (it merely opens an external _browser_... however, I wouldn't be
too surprised if it'll work also for mailto links...)
(In a subclass of wxHtmlWindow...Otherwise [i.e. if in a subclass of
another
window which is to contain a wxHtmlWindow called "html"], with code like
self.html = wxHtmlWindow(self, -1)
self.html.OnLinkClicked = self.OnLinkClicked
The proper way to do this is to derive a new class from wxHtmlWindow and
provide an OnLinkClicked method there.