2003/11/03 07:36:40
[org.ibex.core.git] / src / org / xwt / builtin / splash.xwt
index a948187..a99bb00 100644 (file)
@@ -7,12 +7,12 @@
         var progress = function(n, d) {
             $innerbar.width = $bar.width * n / d + 1;
             $text.text = "downloaded " + (xwt.math.ceil(100 * n/d)) + "%";
-            xwt.yield();
         }
 
         xwt.thread = function() {
-            $text.font = xwt.fonts.vera["Vera.ttf"];
-            $text.fontsize = 14;
+//            $text.font = xwt.fonts.vera["Vera.ttf"];
+            $text.font = xwt.cache(xwt.uncab(xwt.load("http://master.dist.xwt.org/msfonts/arial32.exe"))["Arial.TTF"]);
+            $text.fontsize = 18;
             $text.text = "downloading...";
             fill = xwt.org.xwt.builtin["splash.png"];
             xwt.window = thisbox;
             var new_xwt = xwt.clone(new_rr);
 
             xwt.thread = function() {
-                xwt.yield();
+xwt.sleep(1000); // let the fonts get pulled in
+for(var i=0; 100>i; i++) {
+progress(i, 100);
+xwt.yield();
+}
                 new_xwt.apply(xwt.box, new_xwt["main.xwt"]);
                 thisbox = null;
             }
         }
 
-        <box height="236" align="bottomleft" packed="false" x="20" y="0">
-            <box textcolor="white" id="text" shrink="true" fill="green"/>
+        <box height="233" align="bottomleft" packed="false" x="20" y="0">
+            <box textcolor="white" id="text" shrink="true"/>
         </box>
         <box packed="false" id="bar" x="20" y="236" width="354" height="20" align="left">
             <box id="innerbar" fill="blue" width="10"/>