Exemple #1
0
func (r *FullscreenRenderer) NewWindow(top int, left int, width int, height int, border bool) Window {
	win := C.newwin(C.int(height), C.int(width), C.int(top), C.int(left))
	if r.theme != nil {
		C.wbkgd(win, C.chtype(C.COLOR_PAIR(C.int(ColNormal.index()))))
	}
	if border {
		pair, attr := _colorFn(ColBorder, 0)
		C.wcolor_set(win, pair, nil)
		C.wattron(win, attr)
		C.box(win, 0, 0)
		C.wattroff(win, attr)
		C.wcolor_set(win, 0, nil)
	}

	return &CursesWindow{
		impl:   win,
		top:    top,
		left:   left,
		width:  width,
		height: height,
	}
}
Exemple #2
0
func NewWindow(top int, left int, width int, height int, border bool) *Window {
	win := C.newwin(C.int(height), C.int(width), C.int(top), C.int(left))
	if _color {
		C.wbkgd(win, C.chtype(C.COLOR_PAIR(C.int(ColNormal))))
	}
	if border {
		pair, attr := _colorFn(ColBorder, 0)
		C.wcolor_set(win, pair, nil)
		C.wattron(win, attr)
		C.box(win, 0, 0)
		C.wattroff(win, attr)
		C.wcolor_set(win, 0, nil)
	}

	return &Window{
		impl:   (*WindowImpl)(win),
		Top:    top,
		Left:   left,
		Width:  width,
		Height: height,
	}
}
Exemple #3
0
func (win *Window) Background(colour int) {
	C.wbkgd((*C.WINDOW)(win), C.chtype(colour))
}
Exemple #4
0
// SetBackground fills the background with the supplied attributes and/or
// characters.
func (w *Window) SetBackground(attr Char) {
	C.wbkgd(w.win, C.chtype(attr))
}
Exemple #5
0
func (w *Window) Background(colour int32) {
	C.wbkgd(w.win, C.chtype(colour))
}
Exemple #6
0
func (win *Window) Background(colour int32) {
	in()
	defer out()
	C.wbkgd((*C.WINDOW)(win), C.chtype(colour))
}
Exemple #7
0
func (win *Window) Bkgd(colour chtype) error {
	if C.wbkgd((*C.WINDOW)(win), C.chtype(colour)) == C.ERR {
		return CursesError{"bkgd failed"}
	}
	return nil
}