!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; synchronized void start(int ms, O action) { stop(); timer = doLater_daemon(ms, 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) countdown.stop(); else { final TextImageAction tia = jextractSerializedObject(s, TextImageAction); if (tia != null && isSnippetID(tia.toolTip)) countdown.start(delay, r { snippetToShow = tia.toolTip; S text = loadSnippet_cached(tia.toolTip); if (nempty(text)) swing { if (eq(snippetToShow, tia.toolTip)) frame = showFrame(snippetWithTitle_rev(tia.toolTip), wordWrapTypeWriterTextArea(text), frame); } }); } }