                                :text filename #_(last (string/split @current-filename #"/")) #_@current-filename;; with text set to txt
                                :foreground :blue) 
                       ;:filename @current-filename 
-                      :tip @current-filename 
-                      :icon (.getIcon chooser (file @current-filename))
+                      :tip filename
+                      :icon (.getIcon chooser (file filename))
                       :content (RTextScrollPane. textArea)})))
         
 (defn make-editor-window

  "Check if a file is already open."
  [filename]
  (let [num-tabs (.getTabCount (:tabbed-panel @editor-window))
        tab-names (map #(.getName (.getTabComponentAt (:tabbed-panel @editor-window) %)) (range num-tabs))]
    (some #(= filename %) tab-names)))

(declare add-content-tab-from-filename)
(defn open-file
  "Open a file and add  the tab if it isnt already open."
  [filename]
  (when-not (is-open? filename);; could make tab active if it is already open
    (add-content-tab-from-filename filename @content-pane-params)))

(defn a-open [e]
  (open-file (select-file)))

(defn a-save [e]
  (spit @current-filename (.getText (:text-area (get-editor))))
  #_(set-status "Wrote " filename "."))

(defn a-save-as [e]
  (when-let [selected (select-file)]
    #_(set-current-file selected)
    (spit selected (.getText (:text-area (get-editor))))
    #_(set-status "Wrote " filename ".")))

(defn a-exit  [e] (System/exit 0))
(defn a-copy  [e] (.copy (:text-area (get-editor))))

    #_(println "Switching project:" proj)))

(def ^{:private true} make-icon icon)



(defn add-content-tab
  "Add a tab to the content pane."
