!7 module SpeechRecogConfirmation > DynPrintLog { SingleComponentPanel buttons; visualize { JComponent c = super.visualize(); buttons = singleComponentPanel(); ret centerAndSouth(c, buttons); } start { onSpeechRecognized_withoutMine(voidfunc(fS s) { print("I heard: " + s); print("Did you say that?"); showButtons("Yes", r { log(s, 'yes) }, "No", r { log(s, 'no) }); }); } void log(S heard, S answer) { logStructure(programLogFile(), litorderedmap(+heard, +answer)); } void hideButtons { buttons.setComponent(null); } void showButtons(O... params) { buttons.setComponent(withMargin(centeredButtons(params))); } }