cljfx

https://github.com/cljfx/cljfx
OrdoFlammae 2020-04-08T00:48:00.042Z

Why are the keywords used in the maps not namespaced? They seem like they ought to be namespaced, but they're not. Why is this?

OrdoFlammae 2020-04-08T00:48:12.042300Z

Things like :fx/type.

OrdoFlammae 2020-04-08T00:48:24.042600Z

Which, if it were namespaced, would be something like ::fx/type.

vlaaad 2020-04-08T06:11:32.043100Z

I made up my mind about namespacing keywords after I released cljfx

vlaaad 2020-04-08T06:12:17.044Z

I would have them all namespaced if I were doing it again, but now we are stuck with compatibility 🙂

vlaaad 2020-04-08T06:13:13.044600Z

I learned JavaFX while writing cljfx, I used mostly plain old javadoc: https://openjfx.io/javadoc/14/

vlaaad 2020-04-08T06:25:21.045Z

@ordoflammae ^

OrdoFlammae 2020-04-08T15:53:26.045900Z

All the examples use fx/mount-renderer. However, when you close the window, the program doesn't actually stop. How do you quit the program?

OrdoFlammae 2020-04-08T16:00:55.046400Z

Ah. Thanks.

OrdoFlammae 2020-04-08T16:01:06.046600Z

Why isn't that the default?

vlaaad 2020-04-08T16:05:03.046800Z

If it was the default, it would allow opening only one window per jvm process

vlaaad 2020-04-08T16:07:05.047100Z

Because it would shut down javafx application thread and it can't be restarted once stopped, so no repl-driven development

OrdoFlammae 2020-04-08T16:07:44.047300Z

Is there a way to stop the window process from the REPL without restarting the REPL?

paul a 2020-04-08T16:37:23.047600Z

thanks! that might be useful. ideally, i wouldn't have to know much about JavaFX to be successful with cljfx. i was able to accomplish much of what i wanted with reagent, and i still don't know react at all. i think that whatever you write depends on your audience; there's an audience that's already familiar with JavaFX, and there's an audience that isn't familiar with JavaFX or any similar library. i've never really made any GUI outside of the browser, so i'm not familiar with whatever conventions JavaFX might follow; i also don't know Java, just clojure

vlaaad 2020-04-08T16:50:18.047800Z

What do you mean by window process?

OrdoFlammae 2020-04-08T16:59:08.048Z

I'm not so sure. I realize now that I was just guessing at a solution for a problem I'm having. Basically, when I start a window from the examples, close it, and try to rerun the fx/mount-renderer function, it doesn't show up, presumably because there's a process running in the background that's blocking it.

OrdoFlammae 2020-04-08T16:59:37.048200Z

It does return a promise though, the window just doesn't appear.

OrdoFlammae 2020-04-08T16:59:51.048400Z

The problem is fixed when I restart my REPL.

vlaaad 2020-04-08T17:08:00.048600Z

fx/unmount-renderer and then mount again

vlaaad 2020-04-08T17:08:44.048800Z

Or just call renderer without arguments once to force refresh everything

OrdoFlammae 2020-04-08T17:11:17.049Z

OK, thanks, that makes sense.

vlaaad 2020-04-08T17:15:50.049200Z

What happens is cljfx props are "descriptive, not prescriptive", which means that setting :showing to true does not force the stage to be showing all the time, but instead shows it once and that's it.