# HG changeset patch # User wycc # Date 1282264474 -28800 # Node ID 6879aa403306afbb5d5e6f140462ad77f1610307 # Parent 1719484ed15d991b8cc450c95333bc37aea814d5 Add set_text to the coordinate of the coord_t of the text. diff -r 1719484ed15d -r 6879aa403306 nodejs/svg.js --- 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); } diff -r 1719484ed15d -r 6879aa403306 nodejs/testsvg.js --- 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;