 (defn hide-1x-view [{:keys [frame content-pane split-pane left-panel right-panel]}]
   (doto split-pane
     remember-divider-location!
-    (.remove (.getLeftComponent split-pane))
-    (.remove (.getRightComponent split-pane)))
+    (.remove left-panel)
+    (.remove right-panel))
   (doto content-pane
     (.remove split-pane)
     (.add left-panel))
+  (.setBounds right-panel 0 0 0 0) ; ensures redraw on restoration
   (redraw-frame frame))  
 
 (defn show-1x-view [{:keys [frame content-pane split-pane left-panel right-panel]}]

               #(swap! screen-state-atom
                       assoc :x 0 :y 0 :z 0 :zoom 1)))

;(defn handle-open [window]
;  (bind-window-keys window ["S"] create-dir-dialog))

(defn redraw-frame [frame]
  (doto (.getContentPane frame)


(defn handle-toggle-split [widgets]
  (bind-window-keys (:frame widgets) ["1"] #(toggle-1x-view widgets)))

;; main function enabling controls

(defn make-view-controllable [widgets screen-state-atom]
  (let [panel (:left-panel widgets)]
