3 <template orient="vertical" width="394" height="276" color="white">
5 KeyPressed += function(k) { if (k == "escape") thisbox = null; }
7 var progress = function(n, d) {
8 $innerbar.width = $bar.width * n / d + 1;
9 $text.text = "downloaded " + (xwt.math.ceil(100 * n/d)) + "%";
12 xwt.thread = function() {
13 $text.font = xwt.fonts.vera["Vera.ttf"];
15 $text.text = "downloading...";
16 fill = xwt.org.xwt.builtin["splash.png"];
18 x = (xwt.screenWidth - width) / 2;
19 y = (xwt.screenHeight - height) / 2;
20 var origin = xwt.origin;
21 if (origin.substring(0, 21) == "http://launch.xwt.org") {
22 origin = origin.substring(22);
23 origin = "http://" + origin.substring(origin.indexOf('/') + 1);
25 xwt.println("origin is " + origin);
26 var new_rr = xwt.unzip(xwt.watchProgress(xwt.load(origin), progress));
27 var new_xwt = xwt.clone(new_rr);
29 xwt.thread = function() {
30 for(var i=0; 100>i; i++) { progress(i, 100); xwt.sleep(100); }
32 new_xwt.apply(xwt.box, new_xwt["main.xwt"]);
37 <box height="236" align="bottomleft" packed="false" x="20" y="0">
38 <box textcolor="white" id="text" shrink="true"/>
40 <box packed="false" id="bar" x="20" y="236" width="354" height="20" align="left">
41 <box id="innerbar" fill="blue" width="10"/>