wxIEHTML

tutu milas_gi at hotmail.com
Sat Oct 23 19:44:09 CEST 2004


Cliff Wells <clifford.wells at comcast.net> wrote in message news:<mailman.5354.1098523334.5135.python-list at python.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>



More information about the Python-list mailing list