[seed] Fix many anonymous JS functions that just call *.main_quit to just connect to that function instead.



commit 5c00d2575024994bb904d988bc9b678f9879f0a5
Author: Tim Horton <hortont svn gnome org>
Date:   Thu May 7 22:21:28 2009 -0400

    Fix many anonymous JS functions that just call *.main_quit to just connect to that function instead.
---
 doc/tutorial-standalone/tutorial.html.in |    4 ++--
 examples/clutter-0.8.js                  |    2 +-
 examples/clutter-0.9.js                  |    2 +-
 examples/clutter-transitions/main.js     |    2 +-
 examples/pong/pong.js                    |    2 +-
 examples/same-seed/board.js              |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/tutorial-standalone/tutorial.html.in b/doc/tutorial-standalone/tutorial.html.in
index edcf413..a7954eb 100644
--- a/doc/tutorial-standalone/tutorial.html.in
+++ b/doc/tutorial-standalone/tutorial.html.in
@@ -134,9 +134,9 @@ window.set_title("Browser");
 </pre>
 <p>You can set any number of properties this way, by separating them by commas (<code>{"title": "Browser", "default-height": 500}</code>, etc.). This method should work for any GObject constructor.</p>
 <div class="section">Signals</div>
-<p>You'll notice that our program, as it stands, fails to quit when you click the 'Close' button. You can, of course, quit it with Ctrl-C, but this is certainly unacceptable behaviour. To fix it, we'll connect a JavaScript closure to the signal that gets emitted when the 'Close' button is clicked:</p>
+<p>You'll notice that our program, as it stands, fails to quit when you click the 'Close' button. You can, of course, quit it with Ctrl-C, but this is certainly unacceptable behaviour. To fix it, we'll connect a C function to the signal that gets emitted when the 'Close' button is clicked:</p>
 <pre class="sh_javascript">
-window.signal.hide.connect(function () { Gtk.main_quit(); });
+window.signal.hide.connect(Gtk.main_quit);
 </pre>
 <p>The signal names are the same as in the <a href="http://library.gnome.org/devel/gtk/stable/";>GTK documentation</a>, except using underscores instead of dashes between words. </p>
 <div class="section">GObject Subclassing</div>
diff --git a/examples/clutter-0.8.js b/examples/clutter-0.8.js
index 0495024..db0a8bd 100755
--- a/examples/clutter-0.8.js
+++ b/examples/clutter-0.8.js
@@ -39,7 +39,7 @@ function alpha_func(alpha){
 }
 
 var stage = new Clutter.Stage();
-stage.signal.hide.connect(function(){Clutter.main_quit();});
+stage.signal.hide.connect(Clutter.main_quit);
 var timeline = new Clutter.Timeline({fps:60, num_frames:300});
 stage.show_all();
 
diff --git a/examples/clutter-0.9.js b/examples/clutter-0.9.js
index de8d77c..c7dc8d3 100755
--- a/examples/clutter-0.9.js
+++ b/examples/clutter-0.9.js
@@ -89,7 +89,7 @@ function animate_rectangles(rectangles){
 
 var stage = new Clutter.Stage();
 var rectangles = new Array(colors.length);
-stage.signal.hide.connect(function(){Clutter.main_quit();});
+stage.signal.hide.connect(Clutter.main_quit);
 
 create_rectangles(rectangles, colors);
 
diff --git a/examples/clutter-transitions/main.js b/examples/clutter-transitions/main.js
index 8fed75f..3efee18 100755
--- a/examples/clutter-transitions/main.js
+++ b/examples/clutter-transitions/main.js
@@ -10,7 +10,7 @@ Clutter.init(null, null);
 Seed.include("transition-library.js");
 
 var stage = new Clutter.Stage();
-stage.signal.hide.connect(function(){Clutter.main_quit();});
+stage.signal.hide.connect(Clutter.main_quit);
 stage.set_size(1024,768);
 stage.show_all();
 
diff --git a/examples/pong/pong.js b/examples/pong/pong.js
index 44c09f9..fe9d1e5 100755
--- a/examples/pong/pong.js
+++ b/examples/pong/pong.js
@@ -263,7 +263,7 @@ var black = new Clutter.Color();
 Clutter.color_parse("Black", black);
 
 var stage = new Clutter.Stage();
-stage.signal.hide.connect(function(){Clutter.main_quit();});
+stage.signal.hide.connect(Clutter.main_quit);
 stage.set_size(500,500);
 stage.color = black;
 
diff --git a/examples/same-seed/board.js b/examples/same-seed/board.js
index c3f6661..7eddafa 100644
--- a/examples/same-seed/board.js
+++ b/examples/same-seed/board.js
@@ -292,7 +292,7 @@ Board = new GType({
 			else
 				animating = false;
 			
-			for(;real_x < tiles_w; real_x++)
+			for(; real_x < tiles_w; real_x++)
 				lights[real_x] = null;
 			
 			update_score(cl.length);



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