XObjectBase/GtkTreeStore.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 3 Jul 2012 15:24:17 +0000 (23:24 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 3 Jul 2012 15:24:17 +0000 (23:24 +0800)
XObjectBase/GtkTreeStore.js

index 8f51f47..0543462 100644 (file)
@@ -19,14 +19,23 @@ GtkTreeStore = XObject.define(
         init : function() 
         {
             XObject.prototype.init.call(this);
-            this.el.set_column_types ( 6, [
-                GObject.TYPE_STRING, 
-                GObject.TYPE_STRING, 
-                GObject.TYPE_STRING, 
-                GObject.TYPE_STRING, 
-                GObject.TYPE_STRING, 
-                GObject.TYPE_STRING 
-            ] );
+            
+            if (!this.columns) { 
+                
+                this.el.set_column_types ( 6, [
+                    GObject.TYPE_STRING, 
+                    GObject.TYPE_STRING, 
+                    GObject.TYPE_STRING, 
+                    GObject.TYPE_STRING, 
+                    GObject.TYPE_STRING, 
+                    GObject.TYPE_STRING 
+                ] );
+            } else {
+                 this.el.set_column_types ( this.columns.length, this.columns);
+                  
+                
+            }
+            
             
         }
     }