RE: [Java-gnome-developer] Pb with call back signature for insert _text signal.
Brought to you by:
afcowie
From: Jeffrey M. <Jef...@Br...> - 2001-09-24 19:30:43
|
I have the solution for the problem you were encountering. The callback insert_text has a signature of: void (*insert_text) (GtkEditable *editable, const char *text, gint length, gint *position); Your callback needs to be changed to the following: public void insert_text(String text, int length, GtkObject position) As you can see, the final argument is not handled correctly. This is due to the fact that it is a pointer. In the callback code I cannot determine the actual type of the data for the pointer. This makes the position parameter useless. Hope this helps. -Jeff > > Jeffrey Morgan wrote: > > > Is the printout below taken directly from the output > > when you run the app? > > > Yes. > > > If so, you possibly have a serious > > problem with your JVM. The part of the output that > > reads "ILgnu/gtk/GtkObject" is very strange. > > > Yes, I had been wondering if that was normal or not... > > I have recompiled and reinstalled Java Gnome and retried my small app > with another JVM (Sun jdk1.3.1_01 instead of IBM jdk 1.3) > with the same > result (same error message with the same strange formating). > > > Can > > you send me the entire example and I'll take a look at > > it. > > > Sure, it's minimal and directly adapted from the samples. > > I attach the java source and the glade widget definition. > > Thanks > > Eric > > > > > > -Jeff > > > > > However, at run time, my insert_text method isn't found: > > > > > > vdv@evlist:~/Projects/project1$ java Edit > > > *** ERROR ***: Java-GNOME - cannot find callback method > > > insert_text in > > > the specified object with signature > > > (Ljava/lang/String;ILgnu/gtk/GtkObject;)V > > > *** ERROR ***: Java-GNOME - exception is: > > > Exception in thread "main" java.lang.NoSuchMethodError: > insert_text > > > at gnu.gdk.BaseObject.signalConnect(Native Method) > > > at Edit.<init>(Edit.java:12) > > > at Edit.main(Edit.java:77) > > > > > > ** WARNING **: Java-GNOME - signal will not be mapped > > > > > > > -- > See you in Scottsdale, Arizona. > > http://xmlconnections.com/xml/xmlfall2001/speakers.asp#evandervlist > -------------------------------------------------------------- > ---------- > Eric van der Vlist http://xmlfr.org > http://dyomedea.com > http://xsltunit.org http://4xt.org > http://examplotron.org > -------------------------------------------------------------- > ---------- > > |