fn-fx / fn-fx

A Functional API around JavaFX / OpenJFX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when hotswapping CSS file name

DonyorM opened this issue · comments

I have a setup where the name of my .css file is stored in the data-state atom. I tried using the method suggested by this blog post on how to dynamically update the style on the repl. However, about 50% of the time when I set the css file to a new string (with (swap! data-state assoc-in [:ui :stylesheets] ["main.css"])) the below error occurs. Even if the error doesn't occur, the window does not update its style. At the very least, I imagine the error message should be improved.

#error {
 :cause Assert failed: TODO: Implement this
(= idx (count lst))
 :via
 [{:type java.lang.AssertionError
   :message Assert failed: TODO: Implement this
(= idx (count lst))
   :at [fn_fx.fx_dom.FXDom$fn__18087 invoke fx_dom.clj 33]}]
 :trace
 [[fn_fx.fx_dom.FXDom$fn__18087 invoke fx_dom.clj 33]
  [clojure.lang.AFn run AFn.java 22]
  [com.sun.javafx.application.PlatformImpl lambda$null$173 PlatformImpl.java 295]
  [java.security.AccessController doPrivileged AccessController.java -2]
  [com.sun.javafx.application.PlatformImpl lambda$runLater$174 PlatformImpl.java 294]
  [com.sun.glass.ui.InvokeLaterDispatcher$Future run InvokeLaterDispatcher.java 95]
  [com.sun.glass.ui.gtk.GtkApplication _runLoop GtkApplication.java -2]
  [com.sun.glass.ui.gtk.GtkApplication lambda$null$49 GtkApplication.java 139]
  [java.lang.Thread run Thread.java 745]]}
 "Elapsed time: 3.601076 msecs"

That worked. Thanks for your help.