XObjectBase/GtkTreeViewColumn.js
[app.Builder.js] / XObjectBase / GtkTreeViewColumn.js
index 6f57ceb..79d6e22 100644 (file)
@@ -13,23 +13,31 @@ GtkTreeViewColumn = XObject.define(
         // this is an example...
         GtkTreeViewColumn.ids++;
         this.col_id = GtkTreeViewColumn.ids;
+        
     }, 
     XObject,
     {
+        list : false, // list goes here, 
         pack : function(parent, item) {
+             
+            
             parent.el.append_column(this.el);
             var n = 0;
             var _t = this;
             var col = 0;
-            var found = true; 
-            print("looking for " + this.col_id);
+            var found = false; 
+             
             parent.items.forEach(function(e){
-                print ("parent child : " + XObject.type(e.xtype));
+                if ([ 'GtkListStore', 'GtkTreeStore', 'GtkTreeModelFilter' ].indexOf( XObject.type(e.xtype) ) > -1 ) {
+                    _t.list = e;
+                    return;
+                }
+                
                 
                 if (found) {
                     return true;
                 }
-                print("match " + e.col_id);    
+                 
                 if (e.col_id == _t.col_id) {
                     col = n;
                     found = true;
@@ -43,13 +51,14 @@ GtkTreeViewColumn = XObject.define(
             
             if (this.items.length) {
                 print("child : " + XObject.type(this.items[0].xtype));
+                this.items[0].list = this.list;
                 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???
+                        this.el. (this.items[0].el , 'active', col ); // boolean???
                         break;    
                         
                 }