Exemplo n.º 1
0
func Headline(s string) {
	ansiterm.SavePosn()
	ansiterm.MoveToRC(1, 1)
	ansiterm.ClearLine()
	fmt.Printf("%s", s)
	ansiterm.RestorePosn()
}
Exemplo n.º 2
0
func test_1() {
	const pauseSec = 2
	fmt.Printf("Test_001\n")
	ansiterm.ResetTerm(ansiterm.NORMAL)
	defer ansiterm.ClearPage()

	ansiterm.ClearPage()
	Headline("this headline should be on row 1")
	StatusUpdate("one")
	pause(pauseSec)

	ansiterm.MoveToRC(3, 1)
	Headline("erase page and print Test on third line")
	StatusUpdate("two")
	fmt.Printf("Test\r")
	pause(pauseSec)

	Headline("erase first 3 chars on third line")
	StatusUpdate("three")
	ansiterm.Erase(3)
	pause(pauseSec)

	Headline("print Best on third line")
	StatusUpdate("four")
	fmt.Printf("Best\r")
	pause(pauseSec)

	Headline("erase entire third line")
	StatusUpdate("five")
	ansiterm.ClearLine()
	pause(pauseSec)

	Headline("print Rest on third line")
	StatusUpdate("six")
	fmt.Printf("Rest\r")
	pause(pauseSec)

	Headline("move to 10,10 and print a msg")
	StatusUpdate("seven")
	ansiterm.MoveToRC(10, 10)
	fmt.Printf("x at 10,10")
	pause(pauseSec)
}