golang-exercises/tcell-practice/main.go

32 lines
496 B
Go
Raw Normal View History

2024-03-18 09:13:29 +01:00
package main
import (
"fmt"
"log"
"time"
"github.com/gdamore/tcell/v2"
)
func main() {
fmt.Println()
s, err := tcell.NewScreen()
if err != nil {
log.Fatalf("%v", err)
}
if err := s.Init(); err != nil {
log.Fatalf("%v", err)
}
//defStyle := tcell.StyleDefault.Background
defStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset)
s.SetStyle(defStyle)
for {
s.Clear()
s.SetContent(20, 20, 'A', nil, defStyle)
time.Sleep(time.Second)
}
}