seed r146 - trunk/tests



Author: racarr
Date: Thu Nov  6 15:28:37 2008
New Revision: 146
URL: http://svn.gnome.org/viewvc/seed?rev=146&view=rev

Log:
Make subclass example tie up the prototype chain and test methods.


Modified:
   trunk/tests/subclass.js

Modified: trunk/tests/subclass.js
==============================================================================
--- trunk/tests/subclass.js	(original)
+++ trunk/tests/subclass.js	Thu Nov  6 15:28:37 2008
@@ -11,12 +11,14 @@
 {
     this.gobject_parent = new Gtk.Label({label: "Hello World"});
 }
+HelloLabel.prototype = Seed.prototype(Gtk.Label);
 
 function FooedHelloLabel()
 {
     this.gobject_parent = new HelloLabel();
     this.fooed = true;
 }
+FooedHelloLabel.prototype = HelloLabel.prototype;
 
 function NotALabel()
 {
@@ -39,7 +41,13 @@
 	  {
 	      if (widget.fooed == true)
 	      {
-		      Seed.print("Found a fooed widget");
+		      widget.set_text("Fooed");
+	      }
+	      else
+	      {
+		      widget.set_text("Not fooed");
 	      }
 	  });
 
+w.show_all();
+Gtk.main()



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