seed r586 - trunk/examples



Author: hortont
Date: Wed Dec 31 01:27:15 2008
New Revision: 586
URL: http://svn.gnome.org/viewvc/seed?rev=586&view=rev

Log:
Numerous example updates.


Modified:
   trunk/examples/gtkplug.js
   trunk/examples/introspect.js
   trunk/examples/json-packing.js

Modified: trunk/examples/gtkplug.js
==============================================================================
--- trunk/examples/gtkplug.js	(original)
+++ trunk/examples/gtkplug.js	Wed Dec 31 01:27:15 2008
@@ -13,7 +13,7 @@
 	
 	var pipe = pipes[0];
 
-	var id = parseInt(pipe.read());
+	var id = parseInt(pipe.read(), 10);
 
 	var l = new Gtk.Label({label: "Hello GtkPlug World"});
 	var s = Gtk.Plug._new(id);
@@ -24,7 +24,10 @@
 }
 
 Gtk.init(null, null);
+
 var w = new Gtk.Window();
+w.signal.hide.connect(function () { Gtk.main_quit(); });
+
 var s = new Gtk.Socket();
 var pipe = pipes[1];
 

Modified: trunk/examples/introspect.js
==============================================================================
--- trunk/examples/introspect.js	(original)
+++ trunk/examples/introspect.js	Wed Dec 31 01:27:15 2008
@@ -1,8 +1,11 @@
 #!/usr/bin/env seed
+
+// JSON.stringify and JSON.fromString come from json2.js available on json.org
+// Also in extensions/seed.js.
+
 Seed.import_namespace("Gtk");
 
-proto = Gtk.Window.prototype;
-method = Seed.introspect(proto.translate_coordinates);
-//JSON.stringify and JSON.fromString come from json2.js available on json.org
-//Also in extensions/seed.js.
+var proto = Gtk.Window.prototype;
+var method = Seed.introspect(proto.translate_coordinates);
+
 Seed.print(JSON.stringify(method));

Modified: trunk/examples/json-packing.js
==============================================================================
--- trunk/examples/json-packing.js	(original)
+++ trunk/examples/json-packing.js	Wed Dec 31 01:27:15 2008
@@ -1,25 +1,33 @@
 #!/usr/bin/env seed
+
 Seed.import_namespace("Gtk");
+
 Gtk.init(null, null);
 
-label = new Gtk.Label({label: "Hi!"});
-button = new Gtk.Button({label: "Bye"});
-entry = new Gtk.Entry();
-
-packing = [  
-	{child: label,
-	 fill: false,
-	 padding: 10,
-	 position: Gtk.PackType.End},
-	{child:button,
-	 fill: false,
-	 padding: 100,
-	 expand: true},
-	{child:entry}
+var label = new Gtk.Label({label: "Hi!"});
+var button = new Gtk.Button({label: "Bye"});
+var entry = new Gtk.Entry();
+
+var packing = [
+	{
+		child: label,
+		fill: false,
+		padding: 10,
+		position: Gtk.PackType.End
+	},
+	{
+		child:button,
+		fill: false,
+		padding: 100,
+		expand: true
+	},
+	{
+		child:entry
+	}
 	];
 
 window = new Gtk.Window();
-window.signal.hide.connect(function () {Gtk.main_quit()});
+window.signal.hide.connect(function () { Gtk.main_quit(); });
 vbox = new Gtk.VBox();
 
 vbox.pack(packing);



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