       (.setTitle frame "SimRunner (c) 2014 DEINC")
       (.show frame))))
 
-(defn- start-rendering [app-state]
-  (assoc-in app-state [:ui :model :rendering?] true))
-
-(defn- start-rendering! [{app-state :state}]
-  (when (-> @app-state :ui :model :dirty?)
-    (swap! app-state start-rendering)))
-
-(defn- stop-rendering [app-state]
-  (-> app-state 
-      (assoc-in [:ui :model :rendering?] false)
-      (assoc-in [:ui :model :dirty?] false)))
-
-(defn- stop-rendering! [{app-state :state}]
-  (when (-> @app-state :ui :model :rendering?)
-    (swap! app-state stop-rendering)))
-
-(defn render [app]
-  (gui/gui-do
-    (when (start-rendering! app)
-      (try
-        (io! "Do not update the ui in a transaction!")
-        (finally
-          (stop-rendering! app))))))
-

    [fm.simrunner (config :as config)]
    [fm.simrunner.gui (core :as gui) 
                      (view :as view) 
                      (wiring :as wiring)]))

(defn- lock [app-state]
  (update-in app-state [:ui :model :locked] inc))

(defn- unlock! [{app-state :state}]
  (swap! app-state unlock))

(defn- run-task [{worker :worker :as app} task & args]
  (send-off worker 
            (fn [_ &]
