3 <template thisbox="window" orient="vertical">
5 minwidth = maxwidth = $inner.width;
6 minheight = maxheight = $inner.height;
7 x = (xwt.screenWidth - width) / 2;
8 y = (xwt.screenHeight - height) / 2;
10 xwt.thread = function() {
11 var origin = xwt.origin;
12 if (origin.substring(0, 21) == "http://launch.xwt.org") {
13 origin = origin.substring(22);
14 origin = "http://" + origin.substring(origin.indexOf('/') + 1);
16 xwt.println("origin is " + origin);
18 xwt.loadArchive(origin, function(num, den) {
19 $left.flex = 50 * (num / den);
20 $right.flex = 50 + 50 * (1.0 - num /den);
21 var pct = xwt.math.ceil(num * 100 / den);
23 num = "" + num + " bytes";
24 } else if (1024 * 1024 > num) {
25 num = "" + xwt.math.ceil(num / 1024) + "kb";
27 num = "" + xwt.math.ceil(num / (1024 * 1024)) + "Mb";
29 $status.text = "Downloading: " + pct + "% [" + num + "]";
32 xwt.newBox("main", function(num, den) {
33 $left.flex = 50 + 50 * (num / den);
34 $right.flex = 50 * (1.0 - num / den);
35 if ($right.flex == 0) $right.width = 0;
36 $status.text = "Initializing: " + xwt.math.ceil(num * 100 / den) + "%";
42 <box absolute="true" sizetoimage="true" id="inner" image="org.xwt.builtin.lithium"/>
45 <box text="Downloading user interface..." vshrink="true" hpad="4" vpad="3" id="status" textcolor="white"/>
46 <box hpad="4" height="10">
47 <box flex="0.0" image="org.xwt.builtin.progress" tile="true" id="left"/>
48 <box flex="100.0" id="right"/>