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

index 0577b21..21f66d5 100644 (file)
@@ -25,15 +25,22 @@ GtkListStore = 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);
+                  
+                
+            }
         },
         append : function( values ) {
             var iter = new Gtk.TreeIter();