XObjectBase/GtkTable.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 13 Oct 2010 05:40:33 +0000 (13:40 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 13 Oct 2010 05:40:33 +0000 (13:40 +0800)
XObjectBase/GtkTable.js

index e69de29..74c9aee 100644 (file)
@@ -0,0 +1,35 @@
+
+//<Script type="Text/javascript">
+
+XObject = imports.XObject.XObject
+//GtkClutter.Embed..
+// children are not added at init / but at show stage..
+// listener is added on show..
+// we should really add a hock to destroy it..
+
+GtkTable = {
+    
+    onConstruct : function() 
+    {
+        // set's the packing defaults on child objects..
+        var _this = this;
+        
+        this.items.forEach(function(i,n) {
+            var c = n % _this.config.n_columns;
+            var r = Math.floor(n/_this.config.n_columns);
+            i.pack = [ 'attach', c, c+1, r, r+1, 
+                    typeof(i.x_options) == 'undefined' ?  5 : i.x_options,
+                    typeof(i.y_options) == 'undefined' ?  5 : i.y_options,
+                    typeof(i.x_padding) == 'undefined' ?  0 : i.x_padding,
+                    typeof(i.x_padding) == 'undefined' ?  0 : i.x_padding
+                   
+            ]
+        });
+    },
+    
+    init : function() {
+        
+    }
+
+}; 
\ No newline at end of file