Exemplo 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
}
Exemplo 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)
}
Exemplo 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)
}
Exemplo 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
}
Exemplo 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
}
Exemplo 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,
	}
}
Exemplo 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,
	}
}
Exemplo 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,
	}
}
Exemplo n.º 9
0
func (win *Window) AttrOff(flags int32) {
	C.wattroff((*C.WINDOW)(win), C.int(flags))
}
Exemplo 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)
}
Exemplo n.º 11
0
//Attributes
func (w *Window) Attroff(attrs int) error {
	if C.wattroff(w.win, C.int(attrs)) == ERR {
		return Error
	}
	return nil
}
Exemplo n.º 12
0
func (window *Window) Attroff(attr int) {
	C.wattroff(window.cwin, C.int(attr))
}
Exemplo n.º 13
0
/* Turns an attribute off */
func (w *Window) AttrOff(attr int) {
	C.wattroff((*C.WINDOW)(w), C.int(attr))
}
Exemplo 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)
}