def addnstr(self, y, x, text, n, attr=None): text = _texttype(text) if attr is not None: attr_old = lib.getattrs(self._win) lib.wattrset(self._win, attr) if y is not None: code = lib.mvwaddnstr(self._win, y, x, text, n) else: code = lib.waddnstr(self._win, text, n) if attr is not None: lib.wattrset(self._win, attr_old) return _check_ERR(code, "addnstr")
def addnstr(self, y, x, text, n, attr=None): text = _bytestype(text) if attr is not None: attr_old = lib.getattrs(self._win) lib.wattrset(self._win, attr) if y is not None: code = lib.mvwaddnstr(self._win, y, x, text, n) else: code = lib.waddnstr(self._win, text, n) if attr is not None: lib.wattrset(self._win, attr_old) return _check_ERR(code, "addnstr")