Re: [java-gnome-hackers] Adding switch-page signal
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2009-02-16 02:18:38
|
On Sun, 2009-02-15 at 13:55 +0100, Stefan Schweizer wrote: > On Sat, 2009-02-14 at 22:03 +1100, Andrew Cowie wrote: > > That _might_ work. I kinda doubt it, actually, but it might do as a > > kludge. A patch bundle to this effect is attached. > > Unfortunately changing the parameter to glong did not work. I get a > "java.lang.NoSuchMethodError: receiveSwitchPage" when connecting to the > signal. Do you have a TestCase that runs through this? testReactingToCursorPositionChanges() in ValidateTextBuffer is an example of hooking up a signal that reacts to a programmatic event. If you coded up something like that and sent us a bundle with it, then we could see what you're seeing. As for the NoSuchMethodError, that is what happens when the signature doesn't precisely match. Java VMs are very precise that way. You might have had something incorrect on the other side. If you manually remove the comments hiding lines 521-522 in src/jni/bindings_java_signal.c you'll see some debug info about this. For example, GtkWidget.receiveDeleteEvent() is invoked with a signature of (Lorg/gnome/glib/Signal;JJ)Z with the first J being the long for the pointer address of Widget "source", and the second J being the long for the boxed Event "event". I imagine you'll find it will attempt to find a method called receiveSwitchPage() with a signature of (Lorg/gnome/glib/Signal;JJI)V if you change to glong like I suggested. So then the question would be why the generated receiver method doesn't have a matching signature. Actually, the real question is what *actually* it is being invoked as (since you can't change what GLib thinks the parameters are); presumably it's not what I speculated above since presumably having changed that parameter to glong would have caused a receive of that signature no problem. Once you find out what is actually being composed, then can you come up with something else for the .defs data that you can cause the signature of the generated receiveSwitchPage() to match. Should be fairly straight forward once you know what it's feeding you. AfC Sydney |