This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-11
Channels
- # announcements (6)
- # babashka (61)
- # beginners (85)
- # calva (21)
- # cider (6)
- # clara (9)
- # clj-http (1)
- # clj-kondo (35)
- # cljfx (6)
- # clojure (91)
- # clojure-australia (11)
- # clojure-europe (23)
- # clojure-italy (7)
- # clojure-losangeles (2)
- # clojure-nl (27)
- # clojure-uk (107)
- # clojurescript (4)
- # community-development (1)
- # cursive (69)
- # emacs (12)
- # fulcro (29)
- # graalvm (25)
- # honeysql (10)
- # hugsql (3)
- # integrant (13)
- # jobs (4)
- # kaocha (3)
- # keechma (1)
- # lambdaisland (3)
- # leiningen (2)
- # meander (17)
- # mount (3)
- # observability (1)
- # off-topic (86)
- # pathom (3)
- # polylith (2)
- # practicalli (14)
- # reitit (14)
- # shadow-cljs (61)
- # startup-in-a-month (1)
- # tools-deps (9)
- # vim (54)
- # xtdb (16)
I'm trying to use webviews, but I'm struggling a bit, here is my code (based on exemple 39) I'm trying to render an https://github.com/FirebaseExtended/firepad/blob/master/examples/ace.html from the https://firepad.io/ website
(ns moi.firepad
(:require [cljfx.api :as fx]
[cljfx.ext.web-view :as fx.ext.web-view])
(:import [javafx.scene.web WebEvent]))
;; this example shows how to use web view extensions that provide access to
;; WebEngine object that is used for obtaining web page information and
;; controlling it
(def *state
(atom
{:title nil
:status nil}))
(def html
(slurp ""))
(defn view [{:keys [title status]}]
{:fx/type :stage
:showing true
:title (str title)
:scene
{:fx/type :scene
:root
{:fx/type :v-box
:children
[{:fx/type fx.ext.web-view/with-engine-props
:desc {:fx/type :web-view}
:props {:content html
:on-title-changed #(swap! *state assoc :title %)
:on-status-changed #(swap! *state assoc :status (.getData ^WebEvent %))}}
{:fx/type :label
:text (str status)}]}}})
(def renderer
(fx/create-renderer
:middleware (fx/wrap-map-desc #'view)))
(fx/mount-renderer *state renderer)
It renders a blank window, I don't know what is going on... any help would be appreciated 🙂@pbaille I haven’t tried to run it, but your html contains this:
//// Initialize Firebase.
//// TODO: replace with your Firebase project configuration.
var config = {
apiKey: '<API_KEY>',
authDomain: "",
databaseURL: ""
};
maybe you need to use correct API key for that page to show anything?