 
 ; -------------------------------------------------------------------
 
-(defn render-prog-frame [prog-frame owner]
-  (apply dom/ul nil
-         (map (fn [[k v]] (dom/li nil (str k ":" (count v))))
-              prog-frame)))
+(defn on-prog-frame-focus [ts label prog-frame]
+  (reset! prog-hover prog-frame)
+  (.add gdom/classes (gdom/getElement "prog-container") "hover"))
+
+(defn on-prog-frame-blur []
+  (reset! prog-hover nil)
+  (.remove gdom/classes (gdom/getElement "prog-container") "hover"))
 
 (defn on-prog-frame-restore [ts label prog-frame]
   ; Time-travel to the past if snapshot is available.


(defn wait-done [done]
  (loop []
    (when (not @done)
      (cljs.core.async.impl.dispatch/process-messages)
      (recur))))

; --------------------------------------------

(defn kv-server [server-addr & ports]
  (let [world (:world @prog-base)
        done (atom false)]
    (act server-init world
         (doseq [port ports]
           (when-let [listen-result-ch (achan server-init)]
             (aput server-init (:net-listen-ch @prog-base)
                   [server-addr port listen-result-ch])
             (when-let [[accept-ch close-accept-ch]
                        (atake server-init listen-result-ch)]
               (cbfg.world.net/server-accept-loop world accept-ch close-accept-ch)
               (prog-event world [:kv-server server-addr port]
                           #(update-in % [:servers server-addr]
                                       conj port)))))
         (reset! done true))
    (wait-done done)))

(defn kv-client [client-addr server-addr server-port]
  (let [world (:world @prog-base)
        done (atom false)]
    (act client-init world
         (let [req-ch (cbfg.world.net/client-loop world (:net-connect-ch @prog-base)
                                                  server-addr server-port
                                                  client-addr (:res-ch @prog-base))]
           (prog-event world [:kv-client client-addr server-addr server-port]
                       #(assoc-in % [:clients client-addr]
                                  {:client-addr client-addr
                                   :server-addr server-addr
                                   :server-port server-port
                                   :req-ch req-ch})))
         (reset! done true))
    (wait-done done)))

            agw (make-ago-world num-worlds)
            get-agw (fn [] agw)
            event-ch (ago-chan agw)
            event-run-ch (ago-chan agw)
            make-timeout-ch (fn [actx delay] (ago-timeout agw delay))
            ; Init the top actx manually to avoid act recursion.
            w [{:gen-id gen-id
