After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 301239 - Cannot read DataColumnObject value from ListStore model
Cannot read DataColumnObject value from ListStore model
Status: VERIFIED FIXED
Product: java-gnome
Classification: Bindings
Component: GTK
Not Applicable
Other Linux
: Normal normal
: ---
Assigned To: Jeffrey Morgan
Jeffrey Morgan
: 313152 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-04-19 20:42 UTC by Marnix Kok
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marnix Kok 2005-04-19 20:42:00 UTC
Version details: 2.6
Distribution/Version: Debian Sid

1. Create a listStore with a model that contains a Text and Object DataColumn
2. Execute the code below

Expected result would be that the second System.out.println would also output
the String returned by toString() inside `obj`. Instead, it does not :-)

	/**
	 * Insert value into list
	 * 
	 * @param obj
	 */
	public void add(Object obj) {
		System.out.println("Adding: " + obj);
		
		TreeIter iter = model.appendRow();
		model.setValue(iter, lbColumns.text, obj.toString());
		model.setValue(iter, lbColumns.object, obj);
		
		System.out.println("Adding object to model:" + model.getValue(iter,
lbColumns.object) + "/" + model);
		
	}

Execution of this method yields the following result: 

Adding: objecttoStringOutput
Adding object to model: null / org.gnu.gtk.ListStore@1f20eeb
Comment 1 Marnix Kok 2005-04-20 20:17:07 UTC
You can find some test code here:

http://linux-box.nl/~marnix/zooi/object-liststore-bug.zip

Cheers,

Marnix
Comment 2 Jeffrey Morgan 2005-04-21 19:57:58 UTC
The problem is a bug in Value class.
Comment 3 Ismael Juma 2005-08-10 19:51:18 UTC
*** Bug 313152 has been marked as a duplicate of this bug. ***
Comment 4 Manuel Clos 2005-12-07 08:50:45 UTC
In which version of gtk-java is this fixed?