forked from babashka/pod-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlanterna.clj
33 lines (22 loc) · 810 Bytes
/
lanterna.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(require '[babashka.pods :refer [load-pod]])
(load-pod 'org.babashka/lanterna "0.0.1")
(require '[pod.babashka.lanterna.terminal :as terminal])
(def terminal (terminal/get-terminal))
(terminal/start terminal)
(terminal/put-string terminal
(str "Hello TUI Babashka!")
10 5)
(terminal/put-string terminal
(str "The size of this terminal: "
(terminal/get-size terminal))
10 6)
(terminal/put-string terminal
"Press q to exit."
10 7)
(terminal/flush terminal)
(def k (terminal/get-key-blocking terminal))
(terminal/put-string terminal
(str "You pressed: " k)
10 8)
(Thread/sleep 1000)
(terminal/stop terminal)