         :scroll-pane sp
         :menus menus}))
 
-#_(defn make-repl-output-window
-    "Make an editor window."
-    [params]
-    (let [f (frame :title "Brevis - REPL Output" :width 800 :height 200 :minimum-size [800 :by 360])
-          text-area (text :multi-line? true :font "MONOSPACED-PLAIN-14"
-                                           :text "> ")
-          area (scrollable text-area)
-          listener-thread (Thread. (fn []  
-                                     (loop []
-                                       (let [resp (nrepl.transport/recv (:client @repl) 20)]
-                                         (when resp
-                                           (when (:out resp) (write-stdout-repl (:out resp)))
-                                           (when (:value resp) (write-value-repl (:value resp)))))
-                                       (recur))))]
-     (display f area)
-     (-> f pack! show!)
-     (.setLocation f 850 650)      
-     {:frame f
-      :scrollable area
-      :listener-thread listener-thread
-      :text-area text-area}))
-
 (defn make-repl-output-window
     "Make an editor window."
     [params]

(def repl-outputstream
  (atom nil))

(def ui-window
  "The complete UI panel." (atom nil))

#_(def keybind-handlers
   "Map of keybinds."
   (atom {}))

#_(defn add-keybind-handler
   "Add a keybind handler.
event-type is a map with at least 
  - :type in [:keyPressed]
  - :context in [:input-type]]
predicate is (fn [e] ...)
response is (fn [e context] ...) where e is an Event, and context is a hash-map with relevant widgets and such"
   [name event-type predicate response]
   #_(println "Adding keybind:" name)
   (swap! keybind-handlers assoc 
          (str "keybind_" name) #_(gensym "keybind")
          {:event-type event-type,
           :predicate predicate,
           :response response}))

#_(defn add-keybind-handler
    "Add a keybind handler.
event-type is a map with at least 
  - :type in [:keyPressed]
  - :context in [:input-type]]
keystroke :
KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
                            java.awt.event.InputEvent.CTRL_DOWN_MASK)
or
KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
                       java.awt.event.InputEvent.CTRL_DOWN_MASK
                       | java.awt.event.InputEvent.SHIFT_DOWN_MASK)
response is (fn [e context] ...) where e is an Event, and context is a hash-map with relevant widgets and such"
    [name event-type keystroke response]
    #_(println "Adding keybind:" name)
    (swap! keybind-handlers assoc 
           (str "keybind_" name) #_(gensym "keybind")
           {:event-type event-type,
            :keystroke keystroke,
            :response response}))

;component.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
;                            java.awt.event.InputEvent.CTRL_DOWN_MASK),
;                    "actionMapKey");
;component.getActionMap().put("actionMapKey",
;                     someAction);

;;

(def chooser (javax.swing.JFileChooser.)) ; FileChooser hack to get system icons
(def current-filename (atom nil))

    (reset! current-filename (:current-filename @current-profile))
    (make-ui)
    (load-file (str "src" File/separator "brevis" File/separator "ui" File/separator "keybinds.clj"))
    (add-content-tab-from-filename @current-filename params)
    #_(when-not (empty? (:current-filename @current-profile))      
       (.setText (:text-area ew) (slurp @current-filename)))))

(when (find-ns 'ccw.complete)
  (-main))
