XObjectBase/GtkTreeViewColumn.js
[app.Builder.js] / XObjectBase / GtkTreeViewColumn.js
index 73f4dc9..c97d796 100644 (file)
@@ -16,21 +16,31 @@ GtkTreeViewColumn = XObject.define(
     }, 
     XObject,
     {
-        pack : false,
-        init : function() 
-        {
-            // this is done before pack?
-            this.el = new Gtk.TreeViewColumn();
-            this.parent.el.append_column(this.el);
-            
-            XObject.prototype.init.call(this);
-            
+        pack : function(parent, item) {
+            parent.el.append_column(this.el);
+            var n = 0;
+            var _t = this;
+            var col = 0;
+            var found = true; 
+            parent.items.forEach(function(e){
+                if (found) {
+                    return true;
+                }
+                if (e == _t) {
+                    col = n;
+                    found = true;
+                    return;
+                }
+                if (XObject.type(e.xtype) == 'GtkTreeViewColumn') {
+                    n++;
+                }
+            });
             if (this.items.length) {
                 this.el.add_attribute(this.items[0].el , 'markup', 4  );
             }
             
-
             
         }
+         
     }
 );