示例#1
0
文件: filepanel.go 项目: kuzzmi/monk
func PrintHiglighted(window *gc.Window, y int, x int, index int, selected int, text string, isActive bool) {
	if index == selected && isActive {
		window.AttrOn(gc.A_STANDOUT)
	}
	window.MovePrint(y, x, text)
	if index == selected && isActive {
		window.AttrOff(gc.A_STANDOUT)
	}
}
示例#2
0
func printmenu(w *gc.Window, menu []string, active int) {
	y, x := 2, 2
	w.Box(0, 0)
	for i, s := range menu {
		if i == active {
			w.AttrOn(gc.A_REVERSE)
			w.MovePrint(y+i, x, s)
			w.AttrOff(gc.A_REVERSE)
		} else {
			w.MovePrint(y+i, x, s)
		}
	}
	w.Refresh()
}