Re: [java-gnome-hackers] Tree/List widgets
Brought to you by:
afcowie
From: Jeffrey M. <ku...@zo...> - 2002-08-24 13:36:09
|
I will look into this over the weekend. On Sat, 2002-08-24 at 06:00, Mark Howard wrote: > On Fri, 2002-08-23 at 17:46, Mark Howard wrote: > > public Value(Type type) { > > int [] vptr = new int[1]; > > Value.g_value_init(vptr, type.getHandle()); > > handle = vptr[0]; > > } > > Has anyone successfully used the glib.Value object? > > The gtk reference says: > GValue* g_value_init (GValue *value, > GType g_type); > Initializes value with the default value of type. > value : A zero-filled (uninitialized) GValue structure. > g_type : Type the GValue should hold values of. > Returns : <no comment> > > > The JNI code, however, uses the return statement: > /* > * Class: org.gnu.glib.Value > * Method: g_value_init > * Signature: ([Lint ;I)I > */ > JNIEXPORT jint JNICALL Java_org_gnu_glib_Value_g_1value_1init (JNIEnv > *env, jclass cls, > jintArray value, jint type) > { > gint *value_g_g = (gint *) (*env)->GetIntArrayElements (env, value, > NULL); > GValue *value_g = (GValue *)value_g_g; > GType type_g = (GType)&type; > { > return (jint)g_value_init (value_g, type_g); > } > } > > > Although this return value is ignored in the java code: > /** > * Construct a new Value from a given org.gnu.glib.Value. > */ > public Value(Type type) { > int [] vptr = new int[1]; > Value.g_value_init(vptr, type.getHandle()); > handle = vptr[0]; > } > > Could someone who knows more about this please check it and either > confirm that the Value code is correct or try to fix it. > > Thanks > -- > > +----------------------------------------------+ > | Mark Howard cam.ac.uk mh344@ | > | http://www.tildemh.com tildemh.com mh@ | > +----------------------------------------------+ |