Пример #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
}
Пример #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)
}
Пример #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)
}
Пример #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
}
Пример #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
}
Пример #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,
	}
}
Пример #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,
	}
}
Пример #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,
	}
}
Пример #9
0
func (win *Window) AttrOn(flags int32) {
	C.wattron((*C.WINDOW)(win), C.int(flags))
}
Пример #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)
}
Пример #11
0
func (w *Window) Attron(attrs int) error {
	if C.wattron(w.win, C.int(attrs)) == ERR {
		return Error
	}
	return nil
}
Пример #12
0
func (window *Window) Attron(attr int) {
	C.wattron(window.cwin, C.int(attr))
}
Пример #13
0
/* Turns an attribute on (one of the A_ constants or a ColorPair). This attribute will remain set until AttrOff is called on that same attribute, or AttrSet is used without the attribute. Attributes can be OR'd together. */
func (w *Window) AttrOn(attr int) {
	C.wattron((*C.WINDOW)(w), C.int(attr))
}
Пример #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)
}