abstract sclass DynSayAndInputBot > DynPrintLog { S input; transient AbstractSayAndInputBot2 bot; void submitInput { setField(input := trim(input)); print("User: " + input); if (bot != null) bot.inputQueue.add(input); } visual northCenterAndSouthWithMargins( rightAlignedButtons("New dialog", rThread startDialog), super, dm_textFieldAndSubmit_q('input, 'submitInput, focusOnShow := true)); void runBot(AbstractSayAndInputBot2 bot) { this.bot = bot; runBot(); } void runBot { bot.say = (VF1) vfPrintWithPrefix("Bot: "); thread "Bot" { bot.run_public(); print("\n[end]"); } } abstract AbstractSayAndInputBot2 makeBot(); void startDialog { runBot(makeBot()); } start { logModuleOutput(); startDialog(); } }