gosl/data/screen.go

28 lines
378 B
Go
Raw Normal View History

2016-01-18 23:19:51 +01:00
package data // code.bitsetter.de/fun/gosl/data
2016-01-19 16:38:15 +01:00
import (
"fmt"
"log"
"os"
"github.com/rthornton128/goncurses"
)
2016-01-18 23:19:51 +01:00
type Screen struct {
w, h int
data []rune
}
2016-01-19 16:38:15 +01:00
func TestNC() (int, int) {
2016-01-19 16:38:15 +01:00
win, err := goncurses.Init()
if err != nil {
log.Fatal(err)
os.Exit(1)
}
win.Clear()
2016-01-22 20:17:03 +01:00
h, w := win.MaxYX()
2016-01-19 16:38:15 +01:00
goncurses.End()
2016-01-22 20:17:03 +01:00
fmt.Printf("screen: %d x %d\n", w, h)
return w, h
2016-01-19 16:38:15 +01:00
}