mirror of
https://github.com/python/cpython.git
synced 2025-12-10 19:10:59 +00:00
Patch by Charles Waldman to implement an optional nlines argument to
w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
This commit is contained in:
parent
5d56d3665f
commit
716a89c606
1 changed files with 18 additions and 2 deletions
|
|
@ -122,6 +122,7 @@ None clear()
|
||||||
None clrtobot()
|
None clrtobot()
|
||||||
None clrtoeol()
|
None clrtoeol()
|
||||||
None scroll()
|
None scroll()
|
||||||
|
scroll(nlines)
|
||||||
None touchwin()
|
None touchwin()
|
||||||
None touchline(start,count)
|
None touchline(start,count)
|
||||||
IntObject getch(y,x)
|
IntObject getch(y,x)
|
||||||
|
|
@ -841,9 +842,24 @@ PyCursesWindow_Scroll(self,arg)
|
||||||
PyCursesWindowObject *self;
|
PyCursesWindowObject *self;
|
||||||
PyObject * arg;
|
PyObject * arg;
|
||||||
{
|
{
|
||||||
if (!PyArg_NoArgs(arg))
|
int nlines;
|
||||||
|
int use_nlines = FALSE;
|
||||||
|
switch (ARG_COUNT(arg)) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (!PyArg_Parse(arg, "i;nlines", &nlines))
|
||||||
return NULL;
|
return NULL;
|
||||||
return PyCursesCheckERR(scroll(self->win), "scroll");
|
use_nlines = TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
PyErr_SetString(PyExc_TypeError, "scroll requires 0 or 1 arguments");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (use_nlines)
|
||||||
|
return PyCursesCheckERR(wscrl(self->win, nlines), "scroll");
|
||||||
|
else
|
||||||
|
return PyCursesCheckERR(scroll(self->win), "scroll");
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue