In a source file called gui.clj
, I define a frame, fr
, that holds the window for my application, like this:
(def fr (frame ...))
and a run
function that sets up fr
and causes it to repaint when data changes, something like this (modeled on scribble.clj:
(defn run []
(-> fr add-behaviors pack! show!)
(when-data-changes
(swap! state assoc :shapes (dot/g->seesaw t/ws))
(repaint! fr)))
As I'm messing around in the REPL, I often modify a source file and then call c.t.n.repl/refresh
. When I run run
again, it puts up a new window, leaving the old window on the screen. How can I make my (newly updated) code operate on the same window even after a refresh?