Re:Clojure on the Desktop
by phronmophobic on Tuesday March 31, 2020 @12:37PM
(#22739357)
If you're interested in desktop alternatives for clojure, check out https://github.com/phronmophobic/membrane. It's different from javafx in that all the event handling code is pure clojure. For graphics, it uses skia, https://skia.org/.
[ Parent
| on HN ]
Re:Clojure on the Desktop
by capableweb on Tuesday March 31, 2020 @03:27PM
(#22741449)
Love the example with the spacer, guess we're back to building UIs with tables soon as well!
(defn counter [num]
(horizontal-layout
(on :mouse-down (fn [[mouse-x mouse-y]]
(swap! counter-state inc)
nil)
(button "more!"))
(spacer 5 0)
(label num (ui/font nil 19))))
Otherwise, haven't heard about Skia before, so thanks for sharing that, looks really nifty.
Re:Clojure on the Desktop
by phronmophobic on Tuesday March 31, 2020 @03:47PM
(#22741676)
Thanks! More complicated layout strategies are easy to integrate, but spacer works really well for examples since most people can intuit what the result will look like.
Skia has worked well so far. Since it's used by Chrome, Android, and Firefox under the hood, it means that I can reach a lot of platforms "for free".