set flag AllPublic. set flag HaveProcessing. ifdef Processing2 lib 1400094 endifdef ifndef Processing2 lib 1013739 endifndef import processing.core.*; static A pMain(final Class c) { ret first(pMainWithFrame(c)); } static Pair pMainWithFrame(final Class c) { ret swing(func -> Pair { fixContextClassLoader(); A a = nuInstance(c); //Set frames = asSet(listAWTFrames()); PApplet.runSketch(new S[] { c.getName() }, a); //Frame frame = first(listWithoutSet(listAWTFrames(), frames)); ifdef Processing2 Frame frame = a.frame; endifdef ifndef Processing2 Frame frame = cast getOpt(a.getSurface(), 'frame); endifndef ret pair(a, frame); }); } static PApplet2 pMain() { ret pMain(mc()); }