示例#1
0
文件: draw.go 项目: dforsyth/dvi-go
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)
}
示例#2
0
func main() {
	x := 10
	y := 10
	startGoCurses()
	defer stopGoCurses()

	curses.Init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)

	loop(x, y)
}
示例#3
0
文件: sample2.go 项目: adsr/gocurse
func main() {

	startGoCurses()
	defer stopGoCurses()

	curses.Init_pair(1, curses.COLOR_YELLOW, curses.COLOR_GREEN)

	smallwin, _ := curses.Stdwin.Derwin(1, 10, 10, 10)
	smallwin.Attron(curses.Color_pair(1))
	smallwin.Attron(curses.A_BOLD)

	smallwin.Addstr(0, 0, "Hello here", 0)
	smallwin.Getch()

	curses.Stdwin.Clear()
	curses.Stdwin.Refresh()

	smallwin.Resize(1, 5)
	smallwin.Mvwin(20, 20)
	smallwin.Addstr(0, 0, "There", 0)
	smallwin.Getch()

}