cljfx

JAtkins 2021-08-26T21:31:28.001Z

Does cljfx have documentation available on what components are built in, and what types go where?

vlaaad 2021-08-27T05:20:18.001800Z

Built in components are in the source code :)

vlaaad 2021-08-27T05:20:35.002Z

What types go where isn't...

vlaaad 2021-08-27T05:21:09.002200Z

I wanted to create specs for cljfx, but I don't have the time now unfortunately

JAtkins 2021-08-27T06:11:52.002400Z

✅ . Might be able to get better docs for cljfx soon. Will see if I can build it in cljfx 🙂

2021-08-26T22:29:57.001500Z

Hi, I'm having issues understanding how state is supposed to flow. I've create a minimal example that shows my issue. In short, I want to create a component that has a button and a text field beside it. On click of the button, a DirectoryChooser pops up and when a directory is selected, the path is filled into the text field. As is, my global state is correct, but the UI doesn't reflect the state. The text field remains blank. I believe my issue is in the directory-input component as the :text value isn't ready until after the :on-action is triggered. I can make this work by reaching out to *state in directory-input, but I would really like to use this pure approach. Here's a gist if it makes it easier to read: https://gist.github.com/jvtrigueros/721da14b0aa6fb693ba9c1a8ed2359de Any pointers would be greatly appreciated 🙇

vlaaad 2021-08-27T18:34:20.002600Z

Your state has extra state in it

vlaaad 2021-08-27T18:34:49.002800Z

try printing state in root-view

vlaaad 2021-08-27T18:35:16.003Z

it's {:state {:directory ...}} , not {:directory ...}

vlaaad 2021-08-27T18:36:57.003200Z

once you fix that issue, text field starts showing the select folder's name

2021-08-28T04:08:58.003700Z

Thank you! I’ll try it out.

2021-08-30T14:39:05.004100Z

Thank you! I started with one example and then took pieces from another example, I changed the arg to wrap-map-desc

(fx/wrap-map-desc
  (fn [state] (root-view state)))
Then everything works now! Thank you so much!

vlaaad 2021-08-30T15:33:42.004700Z

Np 🙂 (fx/wrap-map-desc #'root-view) will also work similarly

2021-08-30T15:36:55.004900Z

Oh that actually might work better, thanks for the tip!

2021-08-30T15:38:42.005100Z

With that change, now I just need to eval the root-view