This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-17
Channels
- # announcements (7)
- # babashka (24)
- # beginners (11)
- # boot (16)
- # calva (46)
- # cider (5)
- # clara (3)
- # clj-kondo (2)
- # cljfx (5)
- # clojure (122)
- # clojure-brasil (26)
- # clojure-dev (20)
- # clojure-europe (20)
- # clojure-germany (1)
- # clojure-nl (1)
- # clojure-norway (54)
- # clojure-uk (2)
- # clojurescript (6)
- # core-matrix (23)
- # datomic (85)
- # graalvm (1)
- # honeysql (9)
- # hyperfiddle (31)
- # lsp (3)
- # malli (9)
- # nbb (2)
- # off-topic (15)
- # pathom (15)
- # pedestal (4)
- # polylith (5)
- # re-frame (5)
- # reitit (9)
- # releases (2)
- # shadow-cljs (63)
- # specter (4)
- # xtdb (7)
I was going to do something along the lines of...
{:fx/type :text-field
:user-data {:roles [:search-field]}}
But trying to render the above results in: clojure.lang.ExceptionInfo: No such prop: :user-data {:prop :user-data}
.
According to the JavaFX docs at https://openjfx.io/javadoc/20/javafx.graphics/javafx/scene/Node.html#setUserData(java.lang.Object) .getUserData
and .setUserData
are available on every Node
and I could do a workaround with an fx/make-ext-with-props
to add the prop on arbitrary node, but... I wonder if there's any specific reason :user-data
isn't exposed as a prop on every node in cljfx?
Looking at the implementation of cljfx, it seems all that is required to support the prop on every node is to add :user-data [:setter lifecycle/scalar]
to the map at https://github.com/cljfx/cljfx/blob/5f3737989ac1f57a5bf28c0070d1db12901a6d77/src/cljfx/fx/node.clj#L25C5-L25C42. @vlaaad Is my understanding correct here? Would you mind me submitting a PR for this?Here it goes: https://github.com/cljfx/cljfx/pull/176 It's a tiny change and I'm not sure if anything else is needed to merge it. Please let me know if you'd like me to account for anything I could've missed...
Thank you heaps 🎉