RE: [java-gnome-hackers] Tree/List widgets
Brought to you by:
afcowie
From: Jeffrey M. <Jef...@Br...> - 2002-09-03 18:11:19
|
The primary problem with the first and third errors below are that you must provide a valid TreeIter on a call to append. You are just passing 0 as the TreeIter argument to gtk_list_store_append. This is causing the first error. Next, you are constructing a TreeIter passing 0 to the constructor in the append method. This creates an invalid TreeIter which is later used, causing the third error. To resolve these problems I suggest making a change to the generated code for ListStore (and all like classes) passing a TreeIter* as an argument. This will cause the native methods to take an int array as the argument. Using this method you will be able to retrieve the updated TreeIter once the call is made. You should be able to safely create a java TreeIter from this handle. Also, you will need to change the public interface for the append method requiring a valid TreeIter. Let me know if you want help with this. -Jeff > I'm now getting a different error: > (java-gnome:2091): Gtk-CRITICAL **: file gtkliststore.c: line 1294 > (gtk_list_store_append): assertion `iter != NULL' failed > > (java-gnome:2091): GLib-GObject-WARNING **: > gvalue.c:86:g_value_init(): > cannot initialize GValue with type `(null)', the value has > already been > initialized as `(null)' > An unexpected exception has been detected in native code > outside the VM. > Unexpected Signal : 11 occurred at PC=0x49df27d2 > Function name=g_type_check_value_holds > Library=/usr/lib/libgobject-2.0.so.0 > > Current Java thread: > at org.gnu.glib.Value.g_value_set_string(Native Method) > at org.gnu.glib.Value.setString(Value.java:55) > at tree.TreeExample.<init>(TreeExample.java:35) > at tree.TreeExample.main(TreeExample.java:48) > > It's the same line, but looks like a problem with glib.Type > this time. > > -- > > +----------------------------------------------+ > | Mark Howard cam.ac.uk mh344@ | > | http://www.tildemh.com tildemh.com mh@ | > +----------------------------------------------+ > |