Example #1
0
// Turn on character attribute
func (w *Window) AttrOn(attr Char) (err error) {
	if C.ncurses_wattron(w.win, C.int(attr)) == C.ERR {
		err = errors.New(fmt.Sprintf("Failed to set attribute: %s",
			attrList[C.int(attr)]))
	}
	return
}
Example #2
0
// Normally color pairs are turned on via attron() in ncurses but this
// implementation chose to make it seperate
func (w *Window) ColorOn(pair int16) error {
	if C.ncurses_wattron(w.win, C.int(ColorPair(pair))) == C.ERR {
		return errors.New("Failed to enable color pair")
	}
	return nil
}