summaryrefslogtreecommitdiff
path: root/client/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/main.go')
-rw-r--r--client/main.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/client/main.go b/client/main.go
new file mode 100644
index 0000000..1f46a00
--- /dev/null
+++ b/client/main.go
@@ -0,0 +1,31 @@
+package main
+
+import (
+ "citrons.xyz/talk/tui"
+ "time"
+)
+
+func main() {
+ tui.Start()
+
+ app := newApplication("localhost:27508")
+ go app.RunClient()
+
+ drawTick := time.Tick(time.Second / 60)
+ redraw := true
+ for {
+ select {
+ case m := <-app.Messages():
+ m.Handle(app)
+ redraw = true
+ case e := <-tui.Events():
+ app.onInput(e)
+ redraw = true
+ case <-drawTick:
+ if redraw {
+ app.show()
+ redraw = false
+ }
+ }
+ }
+}