nandi/jolt-nativepublic Fork 0
e40b795acdf08fdae31fc3f95e29fcfc01e29eea
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 e40b795acdf08fdae31fc3f95e29fcfc01e29eea · nandi · 12d ago
counter.clj · 21 lines · 702 BClojure Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
(ns glimmer-tui.counter
  "The smallest thing that shows the backend works: a number and two buttons.

  The same component renders under glimmer-vidya in a window. Nothing here
  names a terminal."
  (:require [glimmer.ratom :as r :refer [atom]]
            [glimmer.core :as ui]
            [glimmer-tui.core]))

(defonce n (atom 0))

(defn counter []
  [:vbox {:spacing 1 :margin 2}
   [:title {:label "counter"}]
   [:label {:label (str "n = " @n)}]
   [:hbox {:spacing 2}
    [:button {:label "-" :on-click #(swap! n dec)}]
    [:button {:label "+" :kind :primary :on-click #(swap! n inc)}]]
   [:dim-label {:label "tab moves, enter presses, ctrl-q quits"}]])

(defn -main [& _] (ui/run counter))