Example #1
0
 def refresh(self, *args):
     if lib._m_ispad(self._win):
         if len(args) != 6:
             raise error("noutrefresh() called for a pad requires 6 arguments")
         return _check_ERR(lib.prefresh(self._win, *args), "prefresh")
     else:
         # XXX: Better args check here? We need zero args.
         return _check_ERR(lib.wrefresh(self._win, *args), "wrefresh")
Example #2
0
 def refresh(self, *args):
     if lib._m_ispad(self._win):
         if len(args) != 6:
             raise error(
                 "noutrefresh() called for a pad requires 6 arguments")
         return _check_ERR(lib.prefresh(self._win, *args), "prefresh")
     else:
         # XXX: Better args check here? We need zero args.
         return _check_ERR(lib.wrefresh(self._win, *args), "wrefresh")
Example #3
0
    def echochar(self, ch, attr=None):
        if attr is None:
            attr = lib.A_NORMAL
        ch = _chtype(ch)

        if lib._m_ispad(self._win):
            code = lib.pechochar(self._win, ch | attr)
        else:
            code = lib.wechochar(self._win, ch | attr)
        return _check_ERR(code, "echochar")
Example #4
0
    def echochar(self, ch, attr=None):
        if attr is None:
            attr = lib.A_NORMAL
        ch = _chtype(ch)

        if lib._m_ispad(self._win):
            code = lib.pechochar(self._win, ch | attr)
        else:
            code = lib.wechochar(self._win, ch | attr)
        return _check_ERR(code, "echochar")
Example #5
0
    def subwin(self, *args):
        nlines = 0
        ncols = 0
        if len(args) == 2:
            begin_y, begin_x = args
        elif len(args) == 4:
            nlines, ncols, begin_y, begin_x = args
        else:
            raise error("subwin requires 2 or 4 arguments")

        if lib._m_ispad(self._win):
            win = lib.subpad(self._win, nlines, ncols, begin_y, begin_x)
        else:
            win = lib.subwin(self._win, nlines, ncols, begin_y, begin_x)
        return Window(_check_NULL(win))
Example #6
0
    def subwin(self, *args):
        nlines = 0
        ncols = 0
        if len(args) == 2:
            begin_y, begin_x = args
        elif len(args) == 4:
            nlines, ncols, begin_y, begin_x = args
        else:
            raise error("subwin requires 2 or 4 arguments")

        if lib._m_ispad(self._win):
            win = lib.subpad(self._win, nlines, ncols, begin_y, begin_x)
        else:
            win = lib.subwin(self._win, nlines, ncols, begin_y, begin_x)
        return Window(_check_NULL(win))