Can't cancel page navigation in PyCom if IWebBrowser2

Evgeny E. Ivanov e_e_i at digitalfun.ru
Tue Oct 1 06:29:09 EDT 2002


Hello activepython,

I'm created handler for event OnBeforeNavigate2 of DWebBrowserEvents2
in my PyCom:
#       def OnBeforeNavigate2(self, pDisp=defaultNamedNotOptArg, URL=defaultNamedNotOptArg, Flags=defaultNamedNotOptArg, TargetFrameName=defaultNamedNotOptArg, PostData=defaultNamedNotOptArg, Headers=defaultNamedNotOptArg, Cancel=defaultNamedNotOptArg):
#               """Fired before navigate occurs in the given WebBrowser (window or frameset element). The processing of this navigation may be modified."""

    def OnBeforeNavigate2(self, pDisp, URL, Flags, TargetFrameName, PostData, Headers, Cancel):
        print 'OnBeforeNavigate2: %s\n' % URL
        Cancel = true

But switching Cancel to "true" does't produce desired effect -
navigation proceeded successfully

In type library this parameter listed as "Pointer BOOL (Flags=3)"


-- 
Best regards,
 Evgeny                          mailto:e_e_i at digitalfun.ru

_______________________________________________
ActivePython mailing list
ActivePython at listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython






More information about the Python-list mailing list