Use more annoying names

This commit is contained in:
Sacha Ligthert 2023-11-06 22:36:47 +01:00
parent 78d73a7920
commit f2c3cfd891

View File

@ -1,8 +1,9 @@
package main
import (
"github.com/gdamore/tcell/v2"
"log"
"github.com/gdamore/tcell/v2"
)
func drawText(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string) {
@ -58,9 +59,8 @@ func drawBox(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string)
}
func main() {
// info, err := tcell.LookupTerminfo(os.Getenv("TERM"))
defStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset)
//boxStyle := tcell.StyleDefault.Foreground(tcell.ColorWhite).Background(tcell.ColorPurple)
defaultStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset)
var err error
@ -77,7 +77,7 @@ func main() {
screen.Clear()
drawBox(screen, 0, 0, x-1, y-1, defStyle, "There should be worms here!")
drawBox(screen, 0, 0, x-1, y-1, defaultStyle, "There should be worms here!")
quit := func() {
// You have to catch panics in a defer, clean up, and
@ -97,7 +97,7 @@ func main() {
switch ev := ev.(type) {
case *tcell.EventResize:
x, y := screen.Size()
drawBox(screen, 0, 0, x-1, y-1, defStyle, "There should be worms here!")
drawBox(screen, 0, 0, x-1, y-1, defaultStyle, "There should be worms here!")
screen.Sync()
case *tcell.EventKey:
//fmt.Println("Key: ",ev.Rune())