     (Platform/runLater (fn [] (.setPrefWidth @webview width)))
     (Platform/runLater (fn [] (.sizeToScene @stage)))
     (Platform/runLater (fn [] (.show @stage)))
+    (wait-for-worker)
     (Platform/runLater
       (fn []
         (let [snap (SnapshotParameters.)]

           (javafx.geometry Rectangle2D)
           (javafx.embed.swing SwingFXUtils)
           (javax.imageio ImageIO)
           (java.io File)))

(defonce latch (CountDownLatch. 1))
(defonce webview (atom nil))


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