XObject = imports.XObject.XObject
GObject = imports.gi.GObject;
-//GtkClutter.Embed..
-// children are not added at init / but at show stage..
-// listener is added on show..
-// we should really add a hock to destroy it..
+
+// tree view column.. should really have a better way to determin stuff..
+
GtkTreeViewColumn = XObject.define(
function(cfg) {
XObject.call(this, cfg);
// this is an example...
-
+ GtkTreeViewColumn.ids++;
+ this.col_id = GtkTreeViewColumn.ids;
},
XObject,
{
var _t = this;
var col = 0;
var found = true;
+ print("looking for " + this.col_id);
parent.items.forEach(function(e){
+ print ("parent child : " + XObject.type(e.xtype));
+
if (found) {
return true;
}
- if (e == _t) {
+ print("match " + e.col_id);
+ if (e.col_id == _t.col_id) {
col = n;
found = true;
return;
n++;
}
});
+
+
if (this.items.length) {
- this.el.add_attribute(this.items[0].el , 'markup', 4 );
+ print("child : " + XObject.type(this.items[0].xtype));
+ switch (XObject.type(this.items[0].xtype)) {
+ case "GtkCellRendererText":
+ this.el.add_attribute(this.items[0].el , 'markup', col );
+ break;
+ case "GtkCellRendererToggle":
+ print("toggle col : " + col);
+ this.el.add_attribute(this.items[0].el , 'active', col ); // boolean???
+ break;
+
+ }
+
+
}
}
);
+GtkTreeViewColumn.ids = 0;
\ No newline at end of file