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

Move the jolt libraries under glimmer-backends 19df0d8 · on 0b92f67f944e81120d053ace058b0ffde413140e · nandi · 12d ago
counter.clj · 23 lines · 812 BClojure Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(ns glimmer-vidya.counter
  "glimmer's counter, rendered by egui.

  The only line that names a toolkit is the backend require — the component
  below is the one from glimmer's own README."
  (:require [glimmer.ratom :as r :refer [atom]]
            [glimmer.core :as ui]
            [glimmer-vidya.core]))

(defn counter []
  (let [count (atom 0)]
    (fn []
      [:page {:max-width 420}
       [:card {}
        [:title {:label "Counter"}]
        [:label {:label (str "Count: " @count)}]
        [:hbox {:spacing 8}
         [:button {:label "- 1" :on-click #(swap! count dec)}]
         [:button {:label "+ 1" :kind :primary :on-click #(swap! count inc)}]
         [:button {:label "reset" :on-click #(reset! count 0)}]]]])))

(defn -main [& _]
  (ui/run counter :title "counter" :width 480 :height 320))