diff nodejs/testcase.js @ 749:ed59e659a202

Implement binding for hide/show for shapes and coords
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 25 Aug 2010 19:37:52 +0800
parents 56a5e08cd8af
children cceac4ba259e
line wrap: on
line diff
--- a/nodejs/testcase.js	Wed Aug 25 18:46:47 2010 +0800
+++ b/nodejs/testcase.js	Wed Aug 25 19:37:52 2010 +0800
@@ -42,6 +42,30 @@
 paint.fill(rect);
 root.add_shape(rect);
 
+/* test hide of shapes */
+var sw = 1;
+setInterval(function() {
+	if(sw) {
+	    rect.hide();
+	    sw = 0;
+	} else {
+	    rect.show();
+	    sw = 1;
+	}
+    }, 1000);
+
+/* test hide of coord */
+var cw = 1;
+setInterval(function() {
+	if(sw) {
+	    coord.hide();
+	    cw = 0;
+	} else {
+	    coord.show();
+	    cw = 1;
+	}
+    }, 3000);
+
 /* test removing a coord */
 var rm_coord = mb_rt.coord_new(root);
 var rm_rect1 = mb_rt.rect_new(150, 150, 50, 50, 10, 10);