diff options
| author | citrons <citrons@mondecitronne.com> | 2025-05-30 17:47:35 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-05-30 17:47:35 -0500 |
| commit | b3a01b28cbfe43ef22168a2f81803dccd4e56864 (patch) | |
| tree | 042a79f70fe1b6f08bc3ba6b0ea2dde127b1a1be /client/main.go | |
| parent | 194c63381a8b19f6a9198ff30a307b65acc2af76 (diff) | |
simple client
Diffstat (limited to 'client/main.go')
| -rw-r--r-- | client/main.go | 31 |
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 + } + } + } +} |
