From 4ffe39c8156e529ea77c17801bb1b3b1643a8fa5 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 2 Dec 2010 20:19:25 +0800 Subject: [PATCH] XObjectBase/GtkTreeModelFilter.js --- XObjectBase/GtkTreeModelFilter.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/XObjectBase/GtkTreeModelFilter.js b/XObjectBase/GtkTreeModelFilter.js index 2b55c9b2c..4484a6fed 100644 --- a/XObjectBase/GtkTreeModelFilter.js +++ b/XObjectBase/GtkTreeModelFilter.js @@ -32,15 +32,33 @@ GtkTreeModelFilter = XObject.define( append : function( values ) { this.list.append(values); }, - getValue : function ( path, col) + getValue : function ( path, col) { + // not very type safe... + var tpath = path; + if (typeof(path) == 'string' ) { + tpath = new Gtk.TreePath.from_string(path); + + } - return this.list.getValue(path, col); + var iter = new Gtk.TreeIter(); + this.el.get_iter (iter, tpath) ; + + var gval = new GObject.Value( [this.el.get_column_type(col), null ]); + this.list.el.get_value( iter, col, gval); + print("GET VALUE RETURNED: " + gval.value); + return gval.value; }, setValue : function ( path, col, val) { - this.list.setValue(path,col,val); + var tpath = path; + if (typeof(path) == 'string' ) { + tpath = new Gtk.TreePath.from_string(path); + } + var iter = new Gtk.TreeIter(); + this.el.get_iter (iter, tpath) ; + this.list.el.set_value(iter,col,val); } -- 2.39.2