 (defn render
   ([filename t]
    (export-to-file filename t)
-   (render t))
+   (render t)
+   (Platform/runLater (fn [] (.setTitle @stage filename))))
   ([t]
    (let [body [:body (style
                        :margin "0 !important"

         width (:width attrs)
         height (:height attrs)
         s (hiccup.core/html (conj body t))]
     (Platform/runLater (fn [] (.setPrefHeight @webview height)))
     (Platform/runLater (fn [] (.setPrefWidth @webview width)))
     (render-string s)
     (wait-for-worker)
     (Platform/runLater (fn [] (.sizeToScene @stage)))
     (Platform/runLater (fn [] (.show @stage)))
     s)))

(defonce engine (atom nil))

(defn -start [this internal-stage]
  (.setTitle internal-stage "SVG Output")
  (let [internal-webview (WebView.)
        internal-engine (.getEngine internal-webview)
        layout (VBox. 0.0)
