Re: [java-gnome-hackers] Tree/List widgets
Brought to you by:
afcowie
From: Mark H. <mh...@ti...> - 2002-08-24 10:18:35
|
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]; > } Has anyone successfully used the glib.Value object?=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> 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, value, NULL); GValue *value_g =3D (GValue *)value_g_g; GType type_g =3D (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 =3D new int[1]; Value.g_value_init(vptr, type.getHandle()); handle =3D 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 --=20 +----------------------------------------------+ | Mark Howard cam.ac.uk mh344@ | | http://www.tildemh.com tildemh.com mh@ | +----------------------------------------------+ |