sclass G22RecognizerIDE extends G22LAScriptIDE { *(G22Utils g22utils) { super(g22utils); } swappable BufferedImage exampleImage() { ret loadImage2(#1101126); } void modifyIDE_base(JLeftArrowScriptIDE ide) { var old = ide.modifyParser; ide.modifyParser = parser -> { ide.modifyParser_fallback(old, parser); parser.addVar("image"); }; ide.runScript = -> { var compileResult = ide.freshCompileResult(); var script = compileResult.parsedScript; if (script == null) ret; var bg = g22utils.backgroundProcessesUI(); temp bg?.tempAdd(new BackgroundProcessesUI.Entry("Run recognizer on example image")); var result = okOrError(-> { new VarContext ctx; ctx.put(image := entry.image); ret ide.callCompiledObjectWithTimeout( timeoutToRecognizeAnImage, script, ctx); }); ide.showScriptResult(result); }; } }