nandi/jolt-nativepublic Fork 0
fa4ecdfed6a830e6099d5fab9be24ef72ea1923b
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.

counter.jolt · 23 lines · 812 BGDScript3 Blame HistoryRaw
Bring vidya in cfd3e36 nandi 19d ago1(ns glimmer-vidya.counter
2 "glimmer's counter, rendered by egui.
3
4 The only line that names a toolkit is the backend require the component
5 below is the one from glimmer's own README."
6 (:require [glimmer.ratom :as r :refer [atom]]
7 [glimmer.core :as ui]
8 [glimmer-vidya.core]))
9
10(defn counter []
11 (let [count (atom 0)]
12 (fn []
13 [:page {:max-width 420}
14 [:card {}
15 [:title {:label "Counter"}]
16 [:label {:label (str "Count: " @count)}]
17 [:hbox {:spacing 8}
18 [:button {:label "- 1" :on-click #(swap! count dec)}]
19 [:button {:label "+ 1" :kind :primary :on-click #(swap! count inc)}]
20 [:button {:label "reset" :on-click #(reset! count 0)}]]]])))
21
22(defn -main [& _]
23 (ui/run counter :title "counter" :width 480 :height 320))