Florian Fredegar Haftmann
fredegar at haftmann-online.de
Mon Mar 3 12:49:42 CET 2003
I have the following problem:
I'm programming a python programme which controls Internet Explorer
via ActiveX/COM. When a document is read, an event handler is
associated with each button; each time the button is clicked, a
certain action is performed.
When my own handler is finished, he is supposed to call the old
"native" handler. But how is that to be done?
If the old event handler is stored in self.oldevt, a call
only returns a textual representation; i've tried also calls like
.Fire() and .Invoke(), but self.oldevt does'nt have such attributes.
Makepy does not work on self.oldevt.
Of course you could use the .click method, but since I'd like to do
the same procedure with other event handlers, too, that is'nt useful.
def __init__(self, button, oldevt = None):
self.button = button
self.oldevt = oldevt
[... any action ...]
self.oldevt() <----------------------- ?????????????????
tagset = doc.getElementsByTagName('input')
for idx in xrange(tagset.length):
tag = tagset(idx)
if tag.type.lower() in ('submit', 'button', 'reset'):
oldevt = getattr(tag, 'onclick', None)
bhandler = ButtonHandler(tag, oldevt)
tag.onclick = u""
Thanks for any remarks
More information about the Python-list