XObjectBase/GtkTreeViewColumn.js
authorAlan Knowles <alan@akkbhome.com>
Thu, 2 Dec 2010 00:03:52 +0000 (08:03 +0800)
committerAlan Knowles <alan@akkbhome.com>
Thu, 2 Dec 2010 00:03:52 +0000 (08:03 +0800)
XObjectBase/GtkTreeViewColumn.js

index 73f4dc9..3198c8a 100644 (file)
@@ -16,15 +16,41 @@ GtkTreeViewColumn = XObject.define(
     }, 
     XObject,
     {
-        pack : false,
+        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  );
+            }
+            
+            
+        },
         init : function() 
         {
             // this is done before pack?
-            this.el = new Gtk.TreeViewColumn();
-            this.parent.el.append_column(this.el);
+        //    this.el = new Gtk.TreeViewColumn();
+          //  this.parent.el.append_column(this.el);
             
             XObject.prototype.init.call(this);
             
+            
+            
             if (this.items.length) {
                 this.el.add_attribute(this.items[0].el , 'markup', 4  );
             }