2003/10/25 07:50:20
[org.ibex.core.git] / src / org / xwt / builtin / splash.xwt
1 <xwt>
2
3     <template thisbox="window" orient="vertical" width="394" height="276">
4
5         KeyPressed += function(k) { if (k == "escape") thisbox = null; }
6
7         var progress = function(n, d) {
8             $innerbar.width = $bar.width * n / d;
9             xwt.yield();
10         }
11
12         xwt.thread = function() {
13             var img = xwt.org.xwt.builtin["splash.png"];
14             fill = img;
15             xwt.yield();
16             x = (xwt.screenWidth - width) / 2;
17             y = (xwt.screenHeight - height) / 2;
18             var origin = xwt.origin;
19             if (origin.substring(0, 21) == "http://launch.xwt.org") {
20                 origin = origin.substring(22);
21                 origin = "http://" + origin.substring(origin.indexOf('/') + 1);
22             }
23             xwt.println("origin is " + origin);
24             var new_rr = xwt.unzip(xwt.watchProgress(xwt.load(origin), progress));
25             var new_xwt = xwt.clone(new_rr);
26             new_xwt.apply(xwt.box, new_xwt["main.xwt"]);
27         }
28
29         <box packed="false" id="bar" x="20" y="236" width="354" height="18" align="left">
30             <box id="innerbar" fill="blue" width="10"/>
31         </box>
32
33     </template>
34