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);
15 xwt.loadArchive(origin, function(num, den) {
16 $left.flex = 50 * (num / den);
17 $right.flex = 50 + 50 * (1.0 - num /den);
18 var pct = xwt.math.ceil(num * 100 / den);
20 num = "" + num + " bytes";
21 } else if (1024 * 1024 > num) {
22 num = "" + xwt.math.ceil(num / 1024) + "kb";
24 num = "" + xwt.math.ceil(num / (1024 * 1024)) + "Mb";
26 $status.text = "Downloading: " + pct + "% [" + num + "]";
29 xwt.newBox("main", function(num, den) {
30 $left.flex = 50 + 50 * (num / den);
31 $right.flex = 50 * (1.0 - num / den);
32 if ($right.flex == 0) $right.width = 0;
33 $status.text = "Initializing: " + xwt.math.ceil(num * 100 / den) + "%";
39 <box absolute="true" sizetoimage="true" id="inner" image="org.xwt.builtin.lithium"/>
42 <box text="Downloading user interface..." vshrink="true" hpad="30" vpad="3" id="status" textcolor="white"/>
43 <box hpad="4" height="10">
45 <box flex="0.0" image="org.xwt.builtin.progress" tile="true" id="left"/>
46 <box flex="100.0" id="right"/>