This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-25
Channels
- # aleph (18)
- # announcements (7)
- # asami (18)
- # babashka (15)
- # babashka-sci-dev (79)
- # beginners (61)
- # calva (4)
- # clj-kondo (23)
- # cljfx (16)
- # cljs-dev (6)
- # clojure (63)
- # clojure-bay-area (3)
- # clojure-europe (33)
- # clojure-nl (1)
- # clojure-survey (4)
- # clojure-uk (5)
- # clojurescript (37)
- # conjure (1)
- # cursive (8)
- # datahike (7)
- # datalevin (1)
- # datomic (30)
- # emacs (10)
- # events (2)
- # figwheel (2)
- # fulcro (20)
- # google-cloud (1)
- # lsp (6)
- # luminus (4)
- # malli (5)
- # music (3)
- # nextjournal (1)
- # off-topic (9)
- # other-languages (3)
- # pathom (16)
- # polylith (34)
- # re-frame (14)
- # reagent (19)
- # releases (6)
- # sci (2)
- # shadow-cljs (33)
It would be perfect if this could be executed when the scene is shown (i.e., An on-shown event handler), but on-shown is never triggered (See https://github.com/cljfx/cljfx/issues/138). I tried the suggestion https://github.com/cljfx/hn/blob/master/src/hn/core.clj#L51, but it still takes a couple of seconds for the stage/scene to render after the splash screen is closed. I finally settled on just waiting a few seconds, and then closing the splash screen.
I was thinking I could render the stage with :showing as a subscription to a boolean, initially false, then after some timeout period close the splash screen, and change the boolean to true.
https://github.com/defold/defold/blob/editor-dev/editor/src/clj/editor/fxui.clj#L72-L86
this lifecycle makes all listeners in desc and its children to receive all change events
e.g.:
{:fx/type fx/ext-let-refs
:refs {::scene {:fx/type :scene ...}}
:desc {:fx/type ext-with-advance-events
:desc {:fx/type :stage
:on-shown ...
:scene {:fx/type fx/ext-get-ref
:ref ::scene}}}}
Thank you. No need to be sorry! You've done great work on cljfx. It's making my .NET C# development colleagues take a closer look at Clojure.
How can I get the stage "client" width? I want to scale components based on this width.
I usually put it into state, e.g. select some default and add on-width/height-changed listeners