Commit 99aa2641 authored by Guido van Rossum's avatar Guido van Rossum

Patch by Charles Waldman to implement an optional nlines argument to

w.scroll().  (It then calls wscrl(win, nlines) instead of scoll(win).)
parent 8f333c30
......@@ -122,6 +122,7 @@ None clear()
None clrtobot()
None clrtoeol()
None scroll()
scroll(nlines)
None touchwin()
None touchline(start,count)
IntObject getch(y,x)
......@@ -841,8 +842,23 @@ PyCursesWindow_Scroll(self,arg)
PyCursesWindowObject *self;
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;
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");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment