Giter VIP home page Giter VIP logo

Comments (8)

vlaaad avatar vlaaad commented on May 25, 2024

MultiFns should be able to be fx-types too (they are not fn?s)

from cljfx.

vlaaad avatar vlaaad commented on May 25, 2024

There is a performance penalty for using protocols instead of cond, also it's not that great with cljfx concept of this stuff being configurable per renderer

from cljfx.

torkus avatar torkus commented on May 25, 2024

Just an anecdote after having just been bitten by this.

I have a TableView that receives a list of maps as it's :items property. The TableColumns :cell-value-factory property received the keyword :label to pull the 'label' value out of the row map. It died with the below (pretty) obscure message and gigantic callstack:

clojure.lang.ExceptionInfo: Don't know how to coerce {:target javafx.util.Callback, :x :label}
	at cljfx.coerce$fail.invokeStatic(coerce.clj:43)
	at cljfx.coerce$fail.invoke(coerce.clj:42)
	at cljfx.fx.table_column$table_cell_value_factory.invokeStatic(table_column.clj:21)
	at cljfx.fx.table_column$table_cell_value_factory.invoke(table_column.clj:14)
	at cljfx.mutator$setter$fn__18647.invoke(mutator.clj:28)
	at cljfx.mutator$eval18576$fn__18621$G__18563__18632.invoke(mutator.clj:13)
	at cljfx.prop$assign_BANG_.invokeStatic(prop.clj:36)
	at cljfx.prop$assign_BANG_.invoke(prop.clj:34)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:39)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:280)
	at clojure.core$update.invokeStatic(core.clj:6196)
	at clojure.core$update.invoke(core.clj:6188)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6827)
	at clojure.core$reduce.invoke(core.clj:6810)
	at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_extra_props$fn__18953.invoke(lifecycle.clj:348)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:279)
	at clojure.core$update.invokeStatic(core.clj:6196)
	at clojure.core$update.invoke(core.clj:6188)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6827)
	at clojure.core$reduce.invoke(core.clj:6810)
	at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_dynamic_fn$fn__18833.invoke(lifecycle.clj:76)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:280)
	at clojure.core$update.invokeStatic(core.clj:6196)
	at clojure.core$update.invoke(core.clj:6188)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6827)
	at clojure.core$reduce.invoke(core.clj:6810)
	at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_extra_props$fn__18953.invoke(lifecycle.clj:348)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:279)
	at clojure.core$update.invokeStatic(core.clj:6196)
	at clojure.core$update.invoke(core.clj:6188)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6827)
	at clojure.core$reduce.invoke(core.clj:6810)
	at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_dynamic_fn$fn__18833.invoke(lifecycle.clj:76)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:280)
	at clojure.core$update.invokeStatic(core.clj:6196)
	at clojure.core$update.invoke(core.clj:6188)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6827)
	at clojure.core$reduce.invoke(core.clj:6810)
	at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_dynamic_fn$fn__18833.invoke(lifecycle.clj:76)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$wrap_extra_props$fn__18953.invoke(lifecycle.clj:348)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913$fn__18914.invoke(lifecycle.clj:279)
	at clojure.core$update.invokeStatic(core.clj:6196)
	at clojure.core$update.invoke(core.clj:6188)
	at cljfx.lifecycle$wrap_many$fn__18909$fn__18913.invoke(lifecycle.clj:279)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6827)
	at clojure.core$reduce.invoke(core.clj:6810)
	at cljfx.lifecycle$wrap_many$fn__18909.invoke(lifecycle.clj:278)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.composite$create_props$fn__28942.invoke(composite.clj:22)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:377)
	at clojure.core$fn__8437.invokeStatic(core.clj:6845)
	at clojure.core$fn__8437.invoke(core.clj:6830)
	at clojure.core.protocols$fn__8167$G__8162__8176.invoke(protocols.clj:175)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6856)
	at clojure.core$reduce_kv.invoke(core.clj:6847)
	at cljfx.composite$create_props.invokeStatic(composite.clj:17)
	at cljfx.composite$create_props.invoke(composite.clj:16)
	at cljfx.composite$create_composite_component.invokeStatic(composite.clj:29)
	at cljfx.composite$create_composite_component.invoke(composite.clj:26)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$wrap_on_delete$fn__19030.invoke(lifecycle.clj:435)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$create_dynamic_component.invokeStatic(lifecycle.clj:32)
	at cljfx.lifecycle$create_dynamic_component.invoke(lifecycle.clj:29)
	at cljfx.lifecycle$reify__18819.create(lifecycle.clj:39)
	at cljfx.lifecycle$fn__18823.invokeStatic(lifecycle.clj:58)
	at cljfx.lifecycle$fn__18823.invoke(lifecycle.clj:56)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.lifecycle$wrap_map_desc$fn__19037.invoke(lifecycle.clj:446)
	at cljfx.lifecycle$eval18747$fn__18769$G__18734__18778.invoke(lifecycle.clj:17)
	at cljfx.renderer$render_component.invokeStatic(renderer.clj:57)
	at cljfx.renderer$render_component.invoke(renderer.clj:47)
	at cljfx.renderer$create$fn__19371.invoke(renderer.clj:77)
	at cljfx.renderer$perform_render$fn__19322.invoke(renderer.clj:23)
	at cljfx.renderer$perform_render.invokeStatic(renderer.clj:22)
	at cljfx.renderer$perform_render.invoke(renderer.clj:14)
	at cljfx.renderer$request_render$fn__19348$fn__19352.invoke(renderer.clj:44)
	at cljfx.renderer$request_render$fn__19348.invoke(renderer.clj:44)
	at clojure.lang.AFn.run(AFn.java:22)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:834)

I'm enjoying cljfx so far but I'm having to do a lot of web searches and trial and error to figure some basic things out. I'm coming from seesaw so I'm fairly spoilt regarding documentation and examples.

from cljfx.

vlaaad avatar vlaaad commented on May 25, 2024

Hi @torkus! I don't remember why it's like that, but you need to supply a function created by fn, not a keyword, like that:

(defn get-label [m]
  (:label m))

I think it's unnecessary, I'll try to figure out why it is like that and see if it can be fixed. By the way, it has nothing to do with lifecycles :)

from cljfx.

vlaaad avatar vlaaad commented on May 25, 2024

Created an issue: #87

from cljfx.

torkus avatar torkus commented on May 25, 2024

yeah, sorry, wasn't sure and was hesitant to create a new ticket. It was a weird bit of cognitive dissonance to wrap a keyword in a function: https://github.com/ogri-la/strongbox/pull/180/files#diff-6239587cc2f3fc5395df70d4339ffc15R158-R161

from cljfx.

vlaaad avatar vlaaad commented on May 25, 2024

It's fine, issues are a good place to ask questions.

from cljfx.

vlaaad avatar vlaaad commented on May 25, 2024

Agree about wrapping keyword in a function

from cljfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.