hello, I started to test some ideas with cljfx today and I could not find a way to use webview
to loadContent instead of opening an url
do you guys have some ideas on that?
hmm, I had some snippet somewhere, you need a custom prop for that
That would be great, I saw the example in the repo but was not totally clear the directions to go forward
Example using url
(require '[cljfx.api :as fx]
'[cljfx.prop :as fx.prop]
'[cljfx.mutator :as fx.mutator]
'[cljfx.lifecycle :as fx.lifecycle])
(def ext-with-html
(fx/make-ext-with-props
{:html (fx.prop/make
(fx.mutator/setter #(.loadContent (.getEngine ^javafx.scene.web.WebView %1) %2))
fx.lifecycle/scalar)}))
(fx/on-fx-thread
(fx/create-component
{:fx/type :stage
:showing true
:scene {:fx/type :scene
:root {:fx/type ext-with-html
:props {:html "<h1>hello html!</h1>"}
:desc {:fx/type :web-view}}}}))
Oh! great! I will test right now
Thanks @vlaaad. Works just fine