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, } }
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, } }
func (win *Window) Background(colour int) { C.wbkgd((*C.WINDOW)(win), C.chtype(colour)) }
// SetBackground fills the background with the supplied attributes and/or // characters. func (w *Window) SetBackground(attr Char) { C.wbkgd(w.win, C.chtype(attr)) }
func (w *Window) Background(colour int32) { C.wbkgd(w.win, C.chtype(colour)) }
func (win *Window) Background(colour int32) { in() defer out() C.wbkgd((*C.WINDOW)(win), C.chtype(colour)) }
func (win *Window) Bkgd(colour chtype) error { if C.wbkgd((*C.WINDOW)(win), C.chtype(colour)) == C.ERR { return CursesError{"bkgd failed"} } return nil }