[webkit-gtk] GObject bindings ... how to add/remove DOM event listeners?

C Anthony Risinger anthony at xtfx.me
Sun Feb 5 00:38:22 PST 2012

On Sat, Feb 4, 2012 at 12:00 PM, C Anthony Risinger <anthony at xtfx.me> wrote:
> Could someone point me in the right direction?  Other methods like
> dispatch_event and release_events suggest it's possible, and I found the
> commit last March switching from signals to explicit listener functions.  I
> also see add_event_listener and remove_event_listener on
> WebKit.DOMEventTargetIface ... exposed as a property() in python but ...
> ... how to make use?  Any direction/pointer/example much appreciated.

i removed `introspection="0"` from
add_event_handler/remove_event_handler, rebuilt the typelib, then

someDOMEelement.add_event_listener('mouseover', somefunc, 1, self)

... which of course failed, but i had to see it work!  to lift my
spirits!  it failed with:

** ERROR **: Invalid scope reached inside Callback.  Possibly a bad annotation?
Trace/breakpoint trap

... a seemingly appropriate error considering my manual adjustments.
i'm pretty green to the introspection scene, but have followed Webkit
progress on it since the beginning ...

****is it currently possible to use
add_event_handler/remove_event_handler from Python?****

the add/remove handlers are missing from all the EventTargets, but
available on EventTargetIface, and everything i read suggests i'm
simply using it incorrectly, esp. considering the change from signals
was almost 1yr ago:

i've spent 3 full nights at this point -- if it's incredibly obvious,
i'm totally oblivious ... but i'll continue anyway. if this is not
currently possible, i would absolutely love to hear this as well, so i
can end the madness (though i really really hope there is a solution

thanks much for your time,


C Anthony

More information about the webkit-gtk mailing list