!7 static double delay = 1.0; // need 1 second hover before showing source code static JFrame frame; static new Countdown countdown; static S snippetToShow; sclass Countdown { java.util.Timer timer; // stops the countdown and restarts it synchronized void start(double delay, O action) { stop(); timer = doLater_daemon(delay, action); } synchronized void stop() { cancelTimer(timer); timer = null; } } p-subst-autorestart { onLocalMechAppend("Mouse hovers", vf1(f update)); } svoid update(S s) { //infoBox(s); bool off = jfind(s, "no longer") >= 0; if (off) { print("off"); countdown.stop(); } else { final TextImageAction tia = jextractSerializedObject(s, TextImageAction); if (tia != null && isSnippetID(tia.toolTip)) countdown.start(delay, r { snippetToShow = tia.toolTip; fS text = loadSnippet_cached(tia.toolTip); if (nempty(text)) swing { if (eq(snippetToShow, tia.toolTip)) frame = showFrame(snippetWithTitle_rev(tia.toolTip), jscroll(withMargin(wordWrapTypeWriterTextArea(text))), frame); } }); } }