X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=XObjectBase%2FGtkListStore.js;h=382ba196b998741b2b5295bcfa1848e6a8eec1ce;hb=3a1d6f2dcc9b4b4d75f50411ff8b784247979a85;hp=4d53b401bb935b636c80cec1fa8a31af1926767b;hpb=47fb3f811e49761afcf138aac5017d25ad6b7532;p=app.Builder.js diff --git a/XObjectBase/GtkListStore.js b/XObjectBase/GtkListStore.js index 4d53b401b..382ba196b 100644 --- a/XObjectBase/GtkListStore.js +++ b/XObjectBase/GtkListStore.js @@ -43,17 +43,30 @@ GtkListStore = XObject.define( getValue : function ( path, col) { // not very type safe... + var tpath = path; + if (typeof(path) == 'string' ) { + tpath = new Gtk.TreePath.from_string(path); + + } + var iter = new Gtk.TreeIter(); - this.el.get_iter (iter, path) ; - var gval = new GObject.Value(''); - this.el.get_value( iter, col, gval) + + this.el.get_iter (iter, tpath) ; + + var gval = new GObject.Value( [this.el.get_column_type(col), null ]); + this.el.get_value( iter, col, gval); + print("GET VALUE RETURNED: " + gval.value); return gval.value; }, setValue : function ( 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, path) ; - this.el.set_value(iter,i,values[i]); + this.el.get_iter (iter, tpath) ; + this.el.set_value(iter,col,val); }