GNOME Bugzilla – Bug 318944
MozEmbed.java callback method error
Last modified: 2006-02-16 11:12:16 UTC
Distribution/Version: Gentoo An exception is thrown when a MozEmbed object is added and a listener is added to it. The error message displayed is: java.lang.Exception: Java-GNOME - cannot find callback method handleProgressAll in the specified object with signature (Lorg/gnu/glib/Handle;II)V From examining the source code, passing a String should be the correct parameter. Test Case: import org.gnu.gtk.Gtk; import org.gnu.gtkmozembed.MozEmbed; import org.gnu.gtkmozembed.event.NetEvent; import org.gnu.gtkmozembed.event.NetListener; public class test { public static void main(String[] args) { Gtk.init(args); MozEmbed me = new MozEmbed(); me.addNetListener(new NetListener() { public void netStart(NetEvent e) {} public void netStop(NetEvent e) {} public void netStateAllChange(NetEvent e) {} public void netStateChange(NetEvent e) {} public void progressAllUpdate(NetEvent e) {} public void progressUpdate(NetEvent e) {} }); Gtk.main(); } }
It seems that the error has disappeared now that I've installed Firefox 1.5. Nonetheless, the code was originally passing a Handle in, which must have worked for Nick when he committed the bindings and example applications to cvs, so the cause of why a String works for some and a Handle works for others is still up in the air.
Created attachment 59381 [details] [review] Patch to overload two callback handling methods to allow it to work for Firefox 1.0.x and Firefox 1.5.x. I hope this works for others, but overloading a callback method seems kind of iffy in my opinion.
Committed to CVS head with a slightly different patch to actually set the URI of the event, which was missing from the patch attached here.