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;
26 this.el = new Gtk.TreeModelFilter.c_new(this.items[0].el, null);
27 XObject.prototype.init.call(this);
30 append : function( values ) {
31 var iter = new Gtk.TreeIter();
33 for (var i = 0; i < values.length; i++) {
34 this.el.set_value(iter,i,values[i]);
38 getValue : function ( path, col)
40 // not very type safe...
42 if (typeof(path) == 'string' ) {
43 tpath = new Gtk.TreePath.from_string(path);
46 var iter = new Gtk.TreeIter();
47 this.el.get_iter (iter, tpath) ;
48 var gval = new GObject.Value( [this.el.get_column_type(col), null ]);
49 this.el.get_value( iter, col, gval);
50 print("GET VALUE RETURNED: " + gval.value);
53 setValue : function ( path, col, val)
56 if (typeof(path) == 'string' ) {
57 tpath = new Gtk.TreePath.from_string(path);
59 var iter = new Gtk.TreeIter();
60 this.el.get_iter (iter, tpath) ;
61 this.el.set_value(iter,col,val);