XObjectBase/GtkTreeModelFilter.js
[app.Builder.js] / XObjectBase / GtkTreeModelFilter.js
index f8b0905..e8a8309 100644 (file)
@@ -23,43 +23,23 @@ GtkTreeModelFilter = XObject.define(
         {
             // 
             this.items[0].pack = false;
+            this.items[0].init();
             this.list = this.items[0];
             this.el = new Gtk.TreeModelFilter.c_new(this.items[0].el, null);
             XObject.prototype.init.call(this);
           
         },
         append : function( values ) {
-            var iter = new Gtk.TreeIter();
-            this.el.append(iter);
-            for (var i = 0; i < values.length; i++) {
-                this.el.set_value(iter,i,values[i]);
-            }
-            
+            this.list.append(values);
         },
         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.call(this, 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.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);
+            this.list.setValue.call(this, path,col,val);
         }