nandi/jolt-nativepublic Fork 0
228672deff39ee418d1b734ed0920ce16985e8e1
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

smoke.clj · 25 lines · 1.0 KBClojure Blame HistoryRaw
glimmer-cosmic: a libcosmic backend for glimmer (spike) 6a3304d nandi 8d ago1(ns glimmer-cosmic.smoke
2 "Non-interactive: opens the window, re-renders from a timer on the worker
3 while libcosmic paints, prints the tree, and quits. Exercises the parts of
4 this backend that differ from glimmer-vidya — mounting before the loop, the
5 worker, schedule, commit, and quit from off the main thread."
6 (:require [glimmer.ratom :as r :refer [atom]]
7 [glimmer.core :as ui]
8 [glimmer-cosmic.core :as backend]))
9
10(def ticks (atom 0))
11
12(defn app []
13 [:page {:max-width 420}
14 [:card {}
15 [:title {:label "smoke"}]
16 [:label {:label (str "ticks: " @ticks)}]
17 [:progress {:value (/ (min @ticks 10) 10.0) :label "re-rendering from a timer"}]
18 [:checkbutton {:label "a checkbox" :active (odd? @ticks)}]
19 [:entry {:placeholder "an entry"}]]])
20
21(defn -main [& _]
22 (backend/every! 100 #(swap! ticks inc))
23 (backend/after! 1500 #(do (backend/dump!) (backend/quit!)))
24 (ui/run app :title "glimmer-cosmic smoke" :width 480 :height 360)
25 (println "run returned; ticks =" @ticks))