I'm trying to use this from clojure. I have a persistent connection to a clojure repl and I'd like to develop without restarting my repl to incorporate a code change. If I launch the app, close the window by clicking the windows X button, and then eval (example) I don't get a working window. I get a window with a blank screen that just reports that it's "not responding". I also tried running the example in a thread but I get the same behavior: (async/thread-call example)
Thanks!
(ns rgkirch.core
(:require [clojure.core.async :as async])
(:import [io.github.humbleui.jwm
App
Event
EventWindowCloseRequest
EventWindowScreenChange
EventWindowResize
EventFrame
LayerGL]
[java.util.function Consumer]))
(defn example
[]
(defonce init (App/init))
(def window (App/makeWindow))
(def layer (LayerGL.))
(defn paint []
(.makeCurrent layer)
(.swapBuffers layer))
(.attach layer window)
(.setTitle window "Hello World")
(.setEventListener window (reify Consumer
(accept [this e]
(do
(println e)
(cond
(instance? EventWindowCloseRequest e)
(do (.close window)
(App/terminate)) ;; terminate here? or this kills my jvm process?
(instance? EventWindowScreenChange e)
(do
(println "screen change")
(.reconfigure layer)
(let [rect (.getContentRect window)]
(.resize layer (.getWidth rect) (.getHeight rect)))
(paint))
(instance? EventWindowResize e)
(do
(println "resize")
(.resize layer (.getContentWidth e) (.getContentHeight e))
(paint))
(instance? EventFrame e)
(do
(paint)
(.requestFrame window)))))))
(.setVisible window true)
(.requestFrame window)
(defonce start (App/start))) ;; defonce here or no? same behavior either way...
(example)
I'm trying to use this from clojure. I have a persistent connection to a clojure repl and I'd like to develop without restarting my repl to incorporate a code change. If I launch the app, close the window by clicking the windows X button, and then eval
(example)I don't get a working window. I get a window with a blank screen that just reports that it's "not responding". I also tried running the example in a thread but I get the same behavior:(async/thread-call example)Thanks!