X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=XObjectBase%2FGtkListStore.js;h=5727b50fedf2077560ea848f1eb56972c0189eca;hb=725599fb2b990df75830d7141cf0c18d12a6dfc6;hp=50fcfb3d51cb5ba40acf208da8f22f283ab97e86;hpb=893985f67b417813f346e67beb2dbd7ab49309d2;p=app.Builder.js diff --git a/XObjectBase/GtkListStore.js b/XObjectBase/GtkListStore.js index 50fcfb3d5..5727b50fe 100644 --- a/XObjectBase/GtkListStore.js +++ b/XObjectBase/GtkListStore.js @@ -36,9 +36,40 @@ GtkListStore = XObject.define( var iter = new Gtk.TreeIter(); this.el.append(iter); for (var i = 0; i < values.length; i++) { - this.el.set_value(iter,i,v[i]); + this.el.set_value(iter,i,values[i]); } + }, + 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, tpath) ; + print(iter); + print(iter.constructor); + //print(XObject.type(iter)); + + 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, tpath) ; + this.el.set_value(iter,col,val); } + + } );