Re: [java-gnome-hackers] Tree/List widgets
Brought to you by:
afcowie
From: Mark H. <mh...@ti...> - 2002-08-30 10:58:52
|
On Sat, 2002-08-24 at 14:35, Jeffrey Morgan wrote: > I will look into this over the weekend. did you get anywhere with this? or has anybody else got any ideas? >=20 > 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 =3D new int[1]; > > > Value.g_value_init(vptr, type.getHandle()); > > > handle =3D vptr[0]; > > > } > >=20 > > Has anyone successfully used the glib.Value object?=20 > >=20 > > 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> > >=20 > >=20 > > 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,=20 > > jintArray value, jint type)=20 > > { > > gint *value_g_g =3D (gint *) (*env)->GetIntArrayElements (env, valu= e, > > NULL); > > GValue *value_g =3D (GValue *)value_g_g; > > GType type_g =3D (GType)&type; > > { > > return (jint)g_value_init (value_g, type_g); > > } > > } > >=20 > >=20 > > 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 =3D new int[1]; > > Value.g_value_init(vptr, type.getHandle()); > > handle =3D vptr[0]; > > } > >=20 > > Could someone who knows more about this please check it and either > > confirm that the Value code is correct or try to fix it. > >=20 > > Thanks > > --=20 --=20 +----------------------------------------------+ | Mark Howard cam.ac.uk mh344@ | | http://www.tildemh.com tildemh.com mh@ | +----------------------------------------------+ |