Esempio n. 1
0
func (w *Window) CFill(str string, fg int, bg int, a Attr) bool {
	attr := _color(PairFor(fg, bg), a)
	C.wattron(w.win, attr)
	ret := w.Fill(str)
	C.wattroff(w.win, attr)
	return ret
}
Esempio n. 2
0
func (w *CursesWindow) CPrint(color ColorPair, attr Attr, text string) {
	p, a := _colorFn(color, attr)
	C.wcolor_set(w.impl, p, nil)
	C.wattron(w.impl, a)
	w.Print(text)
	C.wattroff(w.impl, a)
	C.wcolor_set(w.impl, 0, nil)
}
Esempio n. 3
0
func (w *Window) CPrint(pair ColorPair, attr Attr, text string) {
	p, a := _colorFn(pair, attr)
	C.wcolor_set(w.win(), p, nil)
	C.wattron(w.win(), a)
	w.Print(text)
	C.wattroff(w.win(), a)
	C.wcolor_set(w.win(), 0, nil)
}
Esempio n. 4
0
func (w *CursesWindow) CFill(fg Color, bg Color, attr Attr, str string) FillReturn {
	index := ColorPair{fg, bg, -1}.index()
	C.wcolor_set(w.impl, C.short(index), nil)
	C.wattron(w.impl, C.int(attr))
	ret := w.Fill(str)
	C.wattroff(w.impl, C.int(attr))
	C.wcolor_set(w.impl, 0, nil)
	return ret
}
Esempio n. 5
0
func (w *Window) CFill(str string, fg Color, bg Color, attr Attr) bool {
	pair := PairFor(fg, bg)
	C.wcolor_set(w.win(), C.short(pair), nil)
	C.wattron(w.win(), C.int(attr))
	ret := w.Fill(str)
	C.wattroff(w.win(), C.int(attr))
	C.wcolor_set(w.win(), 0, nil)
	return ret
}
Esempio n. 6
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 border {
		attr := _color(ColBorder, 0)
		C.wattron(win, attr)
		C.box(win, 0, 0)
		C.wattroff(win, attr)
	}
	return &Window{
		win:    win,
		Top:    top,
		Left:   left,
		Width:  width,
		Height: height,
	}
}
Esempio n. 7
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,
	}
}
Esempio n. 8
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,
	}
}
Esempio n. 9
0
func (win *Window) AttrOff(flags int32) {
	C.wattroff((*C.WINDOW)(win), C.int(flags))
}
Esempio n. 10
0
func (w *Window) CPrint(pair int, a Attr, text string) {
	attr := _color(pair, a)
	C.wattron(w.win, attr)
	w.Print(text)
	C.wattroff(w.win, attr)
}
Esempio n. 11
0
//Attributes
func (w *Window) Attroff(attrs int) error {
	if C.wattroff(w.win, C.int(attrs)) == ERR {
		return Error
	}
	return nil
}
Esempio n. 12
0
func (window *Window) Attroff(attr int) {
	C.wattroff(window.cwin, C.int(attr))
}
Esempio n. 13
0
/* Turns an attribute off */
func (w *Window) AttrOff(attr int) {
	C.wattroff((*C.WINDOW)(w), C.int(attr))
}
Esempio n. 14
0
func (w *Window) CPrint(pair int, bold bool, text string) {
	attr := _color(pair, bold)
	C.wattron(w.win, attr)
	w.Print(text)
	C.wattroff(w.win, attr)
}