public static java.net.InetAddress originAddr = null;
public static String originHost = null;
public static String origin = null;
-
- public static Res builtin = null;
+
+ public static final Res builtin = new Res.Zip(new Res.Builtin());
+ public static Picture scarImage = null;
public static void printUsage() {
System.err.println("Usage: xwt [-s] [-v] [-l <port>/<url>] source-location [initial-template]");
Platform.forceLoad();
if (Log.on) for(int i=0; i<args.length; i++) Log.log(Main.class, "argument " + i + ": " + args[i]);
- Res zip = new Res() { public InputStream getInputStream(String path) { return Platform.getBuiltinInputStream(); } };
- builtin = new Res.Zip(zip);
-
String initialTemplateName = args.length > startargs + 1 ? args[startargs + 1] : "main";
initialTemplateName = initialTemplateName.replace('/', '.');
origin = args[startargs];
final XWT xwt = new XWT(rr);
final Res final_rr = rr;
- new Thread(new Runnable() {
- public void run() {
- Message.Q.startQ();
- ThreadMessage.newthread(new JS.Callable() {
- public Object call(JS.Array args) {
- Template.getTemplate(((Res)final_rr.get(initialTemplate))).apply(new Box(), null, xwt);
- return null;
- }
- });
- }
- }).start();
-
+ Picture.fromRes((Res)Main.builtin.get("org/xwt/builtin/scar.png"), new Callback() {
+ public Object call(Object arg) {
+ scarImage = (Picture)arg;
+ Scheduler.add(new Scheduler.Task() {
+ public Object call(Object args) {
+ Template.getTemplate(((Res)final_rr.get(initialTemplate))).apply(new Box(), null, xwt);
+ return null;
+ }
+ });
+ return null;
+ } });
+
+ new Thread() { public void run() { Scheduler.run(); } }.start();
Platform.running();
}