I just started making a GUI app using clojure and seesaw. It does little more that create a JFrame and a couple components. Here's the code. The main function does nothing but call start-gui
and exit as soon as it returns.
(ns pause.gui
(:use seesaw.core))
(native!)
; (javax.swing.UIManager/setLookAndFeel
; "org.pushingpixels.substance.api.skin.SubstanceGraphiteLookAndFeel")
(def main-window
(frame :title "Pause"
:on-close :exit))
(def sidebar (listbox :model []))
(def main-area (text :multi-line? true
:font "MONOSPACED-PLAIN-14"
:text "test"))
(def main-split
(left-right-split (scrollable sidebar)
(scrollable main-area)
:divider-location 1/5))
(defn setup-main-window
"Fills the main window with its content"
[main-window]
(config! main-window
:content main-split)
main-window)
(defn start-gui
"Create the main window"
[]
(-> main-window
setup-main-window
pack!
show!))
I compiled this using lein uberjar
and timed it with time java -jar
. It reported 14.5 seconds. Is there something I'm doing wrong? I'm okay with 3 seconds startup but this is completely unacceptable.