RE: [java-gnome-hackers] Tree/List widgets
Brought to you by:
afcowie
From: Jeffrey M. <Jef...@Br...> - 2002-09-04 11:47:41
|
Let me give it a try this morning. I'll let you know once it is in cvs. -Jeff > 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 > JNIEXPORT jint JNICALL > Java_org_gnu_gtk_ListStore_gtk_1list_1store_1append (JNIEnv > *env, jclass > cls, jint listStore) > { > GtkListStore *listStore_g = (GtkListStore *)listStore; > GtkTreeIter *iter_g = (GtkTreeIter *) > g_malloc(sizeof(GtkTreeIter)); > { > gtk_list_store_append (listStore_g, iter_g); > } > return (jint)iter_g; > } > > This removed the iter errors. > > 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_1strin > g (JNIEnv > *env, > jclass cls, jint listStore, jint iter, jint column, char* > strvalue) > { > GtkListStore *listStore_g = (GtkListStore *)listStore; > GtkTreeIter *iter_g = (GtkTreeIter *)iter; > gint32 column_g = (gint32) column; > > GValue *test; > GValue *value_g = 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). > > 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. > The src/examples/gtk/tree/TreeExample.java is still the current target > for testing. > -- > > +----------------------------------------------+ > | Mark Howard cam.ac.uk mh344@ | > | http://www.tildemh.com tildemh.com mh@ | > +----------------------------------------------+ > |