Fork me on GitHub
#reveal
<
2021-12-03
>
Lukas Domagala01:12:57

@vlaaad good grief, working with the javafx webview is hard! i managed to finally call some js code from inside clojure and then some clojure code from inside js, if you are interested in making that possible

vlaaad06:12:28

Yes I am! I've been meaning to improve web view to host interop, but couldn't find the time so far

vlaaad06:12:57

If you have some snippets to share, that would be nice :)

Lukas Domagala09:12:27

@vlaaad here’s a gist of the basic idea to get both directions working: https://gist.github.com/Cyrik/4928f9db6af820af6fc443c50c958be5 I’d be nice if I could get the WebView without touching the internal of cljfx, but I only just started looking at it. Quick question about cljfx threading stuff: is there a way for me to run some of my code in that tread and to jump back into my thread from an eventHandler?

vlaaad09:12:41

fx/on-fx-thread to run code on ui thread

vlaaad09:12:17

Back into your thread — that looks like something you need to setup yourself..

vlaaad09:12:23

Do you only need serial execution on your thread? Maybe you could use agents in that case..

Lukas Domagala11:12:48

> back into … yeah I don’t think I need anything complicated there. the idea would be to rerun the code that generated some visualization when you click on a specific part of the vega renderer. I haven’t fully figured out the controls or the flow yet, but I’d like to be able to use vega as a UI for my lib, so that they can communicate back and forth. Is there an example somewhere of calling back into user code from a reveal view on the users thread that i could borrow?

vlaaad12:12:24

There is a small Vega example I did before, but that's without 2-way interactions..

Lukas Domagala13:12:20

ah sorry, I explained myself incorrectly. I’ve got my vega running already. what i meant i meant was just a very basic call from inside a reveal window into the user code thread, but i’ll check the docs for that.