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 GtkListStore = XObject.define(
15 XObject.call(this, cfg);
16 // this is an example...
24 XObject.prototype.init.call(this);
25 this.el.set_column_types ( 6, [
35 append : function( values ) {
36 var iter = new Gtk.TreeIter();
38 for (var i = 0; i < values.length; i++) {
39 this.el.set_value(iter,i,values[i]);
43 getValue : function ( path, col)
45 // not very type safe...
47 if (typeof(path) == 'string' ) {
48 tpath = new Gtk.TreePath.from_string(path);
51 var iter = new Gtk.TreeIter();
52 this.el.get_iter (iter, tpath) ;
53 var gval = new GObject.Value(this.el.get_column_type(col));
54 this.el.get_value( iter, col, gval)
57 setValue : function ( path, col, val)
60 if (typeof(path) == 'string' ) {
61 tpath = new Gtk.TreePath.from_string(path);
63 var iter = new Gtk.TreeIter();
64 this.el.get_iter (iter, tpath) ;
65 this.el.set_value(iter,i,values[i]);