Beispiel #1
0
func initscreen(s *Dvi) {
	curses.Initscr()
	curses.Cbreak()
	curses.Noecho()
	curses.Nonl()
	curses.Start_color()
	curses.Stdwin.Keypad(true)

	s.w = curses.Stdwin
	curses.Init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE)
	curses.Init_pair(2, curses.COLOR_RED, curses.COLOR_WHITE)
	curses.Init_pair(3, curses.COLOR_BLACK, curses.COLOR_YELLOW)
}
Beispiel #2
0
func startGoCurses() {
	curses.Initscr()

	if curses.Stdwin == nil {
		stopGoCurses()
		os.Exit(1)
	}

	curses.Noecho()
	curses.Curs_set(curses.CURS_HIDE)
	curses.Stdwin.Keypad(true)

	if err := curses.Start_color(); err != nil {
		fmt.Printf("%s\n", err.String())
		stopGoCurses()
		os.Exit(1)
	}
}