!7 cmodule TrainableBot > DynSockPuppetConvo { LS suggestions; S functions; transient SingleComponentPanel scpSuggestions; transient FunctionsLoader loader; transient Thread playThread; visual jvsplit(super, jhsplit( jCenteredSection("Suggestions", scpSuggestions = singleComponentPanel(renderSuggestions())), northAndCenterWithMargin( jrightaligned(jbutton("Load", rThreadEnter loadFunctions)), dm_textAreaAsSection functions()))); JComponent renderSuggestions() { ret ele_renderSuggestions(null, suggestions); } void showSuggestions(LS suggestions) { setField(+suggestions); showSuggestions(); } void showSuggestions { scpSuggestions?.setComponent(renderSuggestions()); } void loadFunctions { dispose loader; loader = new FunctionsLoader(tlftj(functions)); loader.onLoaded(r startPlaying); loader.loadInBackground(); } void startPlaying enter { cancelThread(playThread); playThread = null; playThread = startThread(rEnter play); } void play { //showSuggestions(ll("test " + now())); new LinkedHashSet l; for (S f : loader.functions) { O o = callOpt(loader.blob, f); if (o cast S) l.add(o); } showSuggestions(l); } }