[java-gnome-hackers] glib Value problems
Brought to you by:
afcowie
From: Mark H. <mh...@ti...> - 2002-12-28 19:51:50
|
Hi, I've realised that I made a few mistakes when working on the tree and list widgets. I'm not entirely sure how to fix them, so any help would be appreciated. 1) In gtk.TreeModel, we use gtk_tree_model_get_value. This initializes and sets a GValue. At present, we are already initializing the GValue by saying Value val = new Value( Type.STRING() ); This produces the warning: GLib-GObject-WARNING **: gvalue.c:86:g_value_init(): cannot initialize GValue with type `gchararray', the value has already been initialized as `gchararray' (but the code does function correctly) I have not been able to work out how else to create a GValue. Merely allocating memory to the size of GValue is not sufficient. (various errors are produced on output - seems like random data is being used) 2) In glib.value jni code for getting and setting java objects uses (*env)->NewGlobalRef(. This is then never destroyed by the GC. I think this should be done by storing a simple gpointer to the object, without making the global reference, however I have not been successful in making this work. -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |