2003/11/13 10:23:10
[org.ibex.core.git] / src / org / xwt / builtin / splash.xwt
index fa07d95..40ed34e 100644 (file)
         }
 
         xwt.thread = function() {
-            $text.font = xwt.fonts.vera["Vera.ttf"];
-            $text.fontsize = 14;
+//            $text.font = xwt.fonts.vera["Vera.ttf"];
+            $text.font = xwt.res.uncab(xwt.res.url("http://master.dist.xwt.org/msfonts/arial32.exe"))["Arial.TTF"];
+//            $text.font = xwt.res.cache(cab["Arial.TTF"]);
+            $text.fontsize = 18;
             $text.text = "downloading...";
             fill = xwt.org.xwt.builtin["splash.png"];
-            xwt.window = thisbox;
-            x = (xwt.screenWidth - width) / 2;
-            y = (xwt.screenHeight - height) / 2;
+            xwt.ui.window = thisbox;
+            thisbox.width = 100;
+            thisbox.height = 100;
+            x = (xwt.ui.screen.width - width) / 2;
+            y = (xwt.ui.screen.height - height) / 2;
             var origin = xwt.origin;
             if (origin.substring(0, 21) == "http://launch.xwt.org") {
                 origin = origin.substring(22);
                 origin = "http://" + origin.substring(origin.indexOf('/') + 1);
             }
-            xwt.println("origin is " + origin);
-            var new_rr = xwt.unzip(xwt.watchProgress(xwt.load(origin), progress));
+            xwt.log.println("origin is " + origin);
+            var new_rr = xwt.res.unzip(xwt.watchProgress(xwt.load(origin), progress));
             var new_xwt = xwt.clone(new_rr);
 
             xwt.thread = function() {
-for(var i=0; 100>i; i++) { progress(i, 100); xwt.sleep(100); }
-                xwt.yield();
+xwt.thread.sleep(1000); // let the fonts get pulled in
+for(var i=0; 100>i; i++) {
+progress(i, 100);
+xwt.thread.yield();
+}
                 new_xwt.apply(xwt.box, new_xwt["main.xwt"]);
                 thisbox = null;
             }
+xwt.log.println("leaving");
         }
 
-        <box height="236" align="bottomleft" packed="false" x="20" y="0">
+        <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">