summaryrefslogtreecommitdiff
path: root/client/main.go
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2025-06-06 00:49:26 -0500
committercitrons <citrons@mondecitronne.com>2025-06-07 16:02:18 -0500
commit553ebc26cda61b567418205f7ee60be122b3c84f (patch)
treecad5406e0b7a8ffd9dacf4dd6a08edd83c2dd4bc /client/main.go
parent83f34e602b050a90816de00e381c78f76831a027 (diff)
clickable, draggable channel list
Diffstat (limited to 'client/main.go')
-rw-r--r--client/main.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/client/main.go b/client/main.go
index 5993cf6..707cf7e 100644
--- a/client/main.go
+++ b/client/main.go
@@ -28,19 +28,21 @@ func main() {
defer globalApp.Stop()
drawTick := time.Tick(time.Second / 60)
- redraw := true
for {
select {
case m := <-globalApp.Messages():
m.Handle(globalApp)
- redraw = true
+ globalApp.redraw = true
case e := <-tui.Events():
globalApp.onInput(e)
- redraw = true
+ globalApp.redraw = true
case <-drawTick:
- if redraw {
- for i := 0; i < 2; i++ {
- // some information takes two passes to propogate
+ if globalApp.redraw {
+ globalApp.show()
+ tui.DrawLayout()
+ // multi-pass
+ for globalApp.redraw {
+ globalApp.redraw = false
tui.Clear()
globalApp.show()
tui.DrawLayout()
@@ -48,12 +50,11 @@ func main() {
if tui.Present() != nil {
os.Exit(-1)
}
- redraw = false
}
case text := <-globalApp.activePaste:
globalApp.onPaste(text)
globalApp.activePaste = nil
- redraw = true
+ globalApp.redraw = true
}
if globalApp.quit == true {
return