473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

wxIEHTML

I know I asked this question before about wxhtml windows(thanks for the
answer), now I'm wanting links to open up in my default browser when I click on
them from a wxIE window. I realize that all I have to do is right-click on the
link and just open it in a separate window, but in the interests of
completeness, if anybody can tell me how this can be done I'd be grateful.
Jul 18 '05 #1
6 1779
On Sat, 2004-10-23 at 04:22 +0000, LutherRevisited wrote:
I know I asked this question before about wxhtml windows(thanks for the
answer), now I'm wanting links to open up in my default browser when I click on
them from a wxIE window. I realize that all I have to do is right-click on the
link and just open it in a separate window, but in the interests of
completeness, if anybody can tell me how this can be done I'd be grateful.


I don't think there's any way to intercept clicking links using the
embedded IE browser. You can check the source file for the module to
get an overview of what you can do.

Cliff

--
Cliff Wells <cl************@comcast.net>

Jul 18 '05 #2
LutherRevisited wrote:
I know I asked this question before about wxhtml windows(thanks for the
answer), now I'm wanting links to open up in my default browser when I click on
them from a wxIE window. I realize that all I have to do is right-click on the
link and just open it in a separate window, but in the interests of
completeness, if anybody can tell me how this can be done I'd be grateful.


In C++ you override the OnStartURL function. I imagine there is an
equivelent Python function.

Alternatively, if you have control over the html you can set
target=_blank for all your links.

Will McGugan
Jul 18 '05 #3
On Sat, 23 Oct 2004 12:35:08 +0100, Will McGugan
<ne**@nowillmcguganspam.com> wrote:
LutherRevisited wrote:
I know I asked this question before about wxhtml windows(thanks for the
answer), now I'm wanting links to open up in my default browser when I click on
them from a wxIE window. I realize that all I have to do is right-click on the
link and just open it in a separate window, but in the interests of
completeness, if anybody can tell me how this can be done I'd be grateful.


In C++ you override the OnStartURL function. I imagine there is an
equivelent Python function.


At which point it would be best to use urllib to open the url, being
that you want the link to open up in the default browser.

Daniel Bickett
Jul 18 '05 #4
Cliff Wells <cl************@comcast.net> wrote in message news:<ma**************************************@pyt hon.org>...
On Sat, 2004-10-23 at 04:22 +0000, LutherRevisited wrote:
I know I asked this question before about wxhtml windows(thanks for the
answer), now I'm wanting links to open up in my default browser when I click on
them from a wxIE window. I realize that all I have to do is right-click on the
link and just open it in a separate window, but in the interests of
completeness, if anybody can tell me how this can be done I'd be grateful.


I don't think there's any way to intercept clicking links using the
embedded IE browser. You can check the source file for the module to
get an overview of what you can do.

Cliff


maybe something like the following?
<pre>
import webbrowser
EVT_MSHTML_BEFORENAVIGATE2(self, -1, self.OnBeforeNavigate2)

def OnBeforeNavigate2(self, event): #IE event
url = event.GetText1()
webbrowser.open(url) #open in default browser
event.Veto() #don't open here
</pre>
Jul 18 '05 #5
On Sat, 2004-10-23 at 10:44 -0700, tutu wrote:
maybe something like the following?
<pre>
import webbrowser
EVT_MSHTML_BEFORENAVIGATE2(self, -1, self.OnBeforeNavigate2)

def OnBeforeNavigate2(self, event): #IE event
url = event.GetText1()
webbrowser.open(url) #open in default browser
event.Veto() #don't open here
</pre>


Ah, cool. Thanks!

--
Cliff Wells <cl************@comcast.net>

Jul 18 '05 #6
Thanks alot, that was perfect.
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.