      (.validate frame)
      new-menus)))
 
-(defvar --- {}
-  "Separator for menu entries used in add-menus.")
-
 ;;; Tool Bar
-
-(defn- ^JToolBar get-toolbar
-  "Returns toolbar of given frame."
-  [frame]
-  (get-component frame #(instance? JToolBar %)))
 
 (defvar ^String default-icon-image (get-resource "images/default.jpg")
   "Default icon image used when no other image is found.")

  side."
  [^JFrame frame, icons]
  (do-swing
   (let [^JToolBar toolbar (get-toolbar frame),
         rem-icons (collapse-separators (remove (set icons) (seq (.getComponents toolbar))))]
     (.removeAll toolbar)
     (doseq [^JComponent icon rem-icons]

  displayed in a message dialog."
  [frame title & body]
  `(try
     ~@body
     (catch Exception e#
       (javax.swing.JOptionPane/showMessageDialog
        ~frame
        (scrollable (apply str (get-root-cause e#) "\n"
                           (interpose "\n" (.getStackTrace e#))))
        ~title
        javax.swing.JOptionPane/ERROR_MESSAGE))))

(defn get-component
  "Returns the first component in component satisfing predicate."
