RE: [java-gnome-hackers] Tree/List widgets
Brought to you by:
afcowie
From: Mark H. <mh...@ti...> - 2002-09-04 09:46:37
|
On Tue, 2002-09-03 at 19:11, Jeffrey Morgan wrote: > Let me know if you want help with this. I do. I've been trying for quite a while now but have made little progress. I changed the TreeIter append method to=20 JNIEXPORT jint JNICALL Java_org_gnu_gtk_ListStore_gtk_1list_1store_1append (JNIEnv *env, jclass cls, jint listStore)=20 { GtkListStore *listStore_g =3D (GtkListStore *)listStore; GtkTreeIter *iter_g =3D (GtkTreeIter *) g_malloc(sizeof(GtkTreeIter)); { gtk_list_store_append (listStore_g, iter_g); } return (jint)iter_g; } This removed the iter errors.=20 But then there are a number of error relating the the glib.Value and glib.Type classes. A number of them were resolved by bypassing those classes and creating new set methods in ListStore (I had planned to do something similar in the java code anyway): JNIEXPORT void JNICALL Java_org_gnu_gtk_ListStore_gtk_1list_1store_1set_1value_1string (JNIEnv *env,=20 jclass cls, jint listStore, jint iter, jint column, char* strvalue)=20 { GtkListStore *listStore_g =3D (GtkListStore *)listStore; GtkTreeIter *iter_g =3D (GtkTreeIter *)iter; gint32 column_g =3D (gint32) column;=09 =09 GValue *test; GValue *value_g =3D g_value_init(test, G_TYPE_STRING); { gtk_list_store_set_value (listStore_g, iter_g, column_g, test); } } This removed more of the warnings, but then I started to get strange errors from the ListStore constructor (which still uses glib.Type).=20 I think the main error is probably something to do with constructing and returning glib.Type objects. Also, there could be problems with gtk_value_init in some places - this takes and empty gvalue as an argument and should initialise it, but there is also a gvalue returned - I'm not sure what this is. I've not committed any of the above changes.=20 The src/examples/gtk/tree/TreeExample.java is still the current target for testing.=20 --=20 +----------------------------------------------+ | Mark Howard cam.ac.uk mh344@ | | http://www.tildemh.com tildemh.com mh@ | +----------------------------------------------+ |