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"
|
|
|
|
|
2016-02-06 01:48:29 +01:00
|
|
|
nc "github.com/rthornton128/goncurses"
|
2016-01-19 16:38:15 +01:00
|
|
|
)
|
|
|
|
|
2016-01-18 23:19:51 +01:00
|
|
|
type Screen struct {
|
|
|
|
w, h int
|
|
|
|
data []rune
|
|
|
|
}
|
2016-01-19 16:38:15 +01:00
|
|
|
|
2016-01-30 02:04:13 +01:00
|
|
|
func TestNC() (int, int) {
|
2016-02-06 01:48:29 +01:00
|
|
|
win, err := nc.Init()
|
2016-01-19 16:38:15 +01:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
win.Clear()
|
2016-01-22 20:17:03 +01:00
|
|
|
h, w := win.MaxYX()
|
2016-02-06 01:48:29 +01:00
|
|
|
nc.End()
|
2016-01-22 20:17:03 +01:00
|
|
|
fmt.Printf("screen: %d x %d\n", w, h)
|
2016-02-06 01:48:29 +01:00
|
|
|
|
2016-01-30 02:04:13 +01:00
|
|
|
return w, h
|
2016-01-19 16:38:15 +01:00
|
|
|
}
|