changeset 732:6879aa403306

Add set_text to the coordinate of the coord_t of the text.
author wycc
date Fri, 20 Aug 2010 08:34:34 +0800
parents 1719484ed15d
children 163f0d9e6382 cdd578c1f866
files nodejs/svg.js nodejs/testsvg.js
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/svg.js	Fri Aug 20 07:25:59 2010 +0800
+++ b/nodejs/svg.js	Fri Aug 20 08:34:34 2010 +0800
@@ -114,6 +114,10 @@
 		}
 	}
 }
+function tspan_set_text(text)
+{
+   this.text.set_text(text); 
+}
 
 loadSVG.prototype.parseTSpan=function(coord, n,style)
 {
@@ -138,6 +142,8 @@
 		} else {
 		}
 	}
+	tcoord.set_text=tspan_set_text;
+	tcoord.text = obj;
     make_mbnames(this.mb_rt, n, tcoord);
 }
 
--- a/nodejs/testsvg.js	Fri Aug 20 07:25:59 2010 +0800
+++ b/nodejs/testsvg.js	Fri Aug 20 08:34:34 2010 +0800
@@ -2,6 +2,7 @@
 var mbapp = require("./mbapp");
 var sys=require("sys");
 var animate=require("./animate");
+var fs = require("fs");
 
 app = new mbapp.app();
 app.loadSVG("test.svg");
@@ -9,6 +10,15 @@
 item=1;
 lightbar[5] = app.get("item"+item)[5];
 
+app.files=fs.readdirSync("/tmp/");
+for(i=1;i<10;i++) {
+    var o = app.get("item"+i+"text");
+	o.set_text(app.files[i]);
+}
+
+
+
+
 app.addKeyListener(mbapp.KEY_UP, function() {
 		item = item - 1;
 		if (item == 0) item = 1;