2 //<Script type="Text/javascript">
4 XObject = imports.XObject.XObject
6 GObject = imports.gi.GObject;
10 // children are not added at init / but at show stage..
11 // listener is added on show..
12 // we should really add a hock to destroy it..
13 GtkTreeModelFilter = XObject.define(
15 XObject.call(this, cfg);
16 // this is an example...
25 this.items[0].pack = false;
27 this.list = this.items[0];
28 this.el = new Gtk.TreeModelFilter.c_new(this.items[0].el, null);
29 XObject.prototype.init.call(this);
32 append : function( values ) {
33 this.list.append(values);
35 getValue : function ( path, col)
37 // not very type safe...
39 if (typeof(path) == 'string' ) {
40 tpath = new Gtk.TreePath.from_string(path);
44 var iter = new Gtk.TreeIter();
46 this.el.get_iter (iter, tpath) ;
47 var citer = new Gtk.TreeIter();
48 this.el.convert_iter_to_child_iter(citer, iter);
50 var gval = new GObject.Value( [this.list.el.get_column_type(col), null ]);
51 this.list.el.get_value( citer, col, gval);
52 print("GET VALUE RETURNED: " + gval.value);
55 setValue : function ( path, col, val)
58 if (typeof(path) == 'string' ) {
59 tpath = new Gtk.TreePath.from_string(path);
61 var iter = new Gtk.TreeIter();
62 var citer = new Gtk.TreeIter();
63 this.el.get_iter (iter, tpath) ;
64 this.el.convert_iter_to_child_iter(citer, iter);
66 this.list.el.set_value(citer,col,val);