seed r130 - trunk/extensions



Author: racarr
Date: Wed Nov  5 14:39:53 2008
New Revision: 130
URL: http://svn.gnome.org/viewvc/seed?rev=130&view=rev

Log:
Add Gtk.Box.pack convenience function, packs a box from an array of key/value pairs.


Added:
   trunk/extensions/Gtk.js   (contents, props changed)
Modified:
   trunk/extensions/Makefile.am

Added: trunk/extensions/Gtk.js
==============================================================================
--- (empty file)
+++ trunk/extensions/Gtk.js	Wed Nov  5 14:39:53 2008
@@ -0,0 +1,26 @@
+(function()
+ {
+	 var pack = function(packing)
+		 {
+			 for ( var i in packing )
+			 {
+				 var entry = packing[i];
+				 var expand = entry["expand"];
+				 var padding = entry["padding"];
+				 var fill = entry["fill"];
+				 var child = entry["child"];
+				 var position = entry["position"];
+
+				 if (position == null)
+					 position = Gtk.PackType.start;
+				 
+				 this.pack_start(child);
+				 this.set_child_packing(child, 
+						       expand,
+						       fill, 
+						       padding, position);
+			 }
+		 }
+	 Seed.prototype(Gtk.VBox).pack = pack;
+	 Seed.prototype(Gtk.HBox).pack = pack;
+ }).apply();
\ No newline at end of file

Modified: trunk/extensions/Makefile.am
==============================================================================
--- trunk/extensions/Makefile.am	(original)
+++ trunk/extensions/Makefile.am	Wed Nov  5 14:39:53 2008
@@ -1,4 +1,4 @@
 EXTRA_DIST= Gio.js Seed.js
 
 extensiondir=$(datadir)/seed
-extension_DATA = Gio.js Seed.js
+extension_DATA = Gio.js Seed.js Gtk.js



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]