diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-04-15 22:06:05 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-04-15 22:06:05 (GMT) |
commit | d2bc389e550464e3f71ec60071880335e8f9b6c6 (patch) | |
tree | ff1e0fd7f6231e3ccf09ca699de88618abd2ddf7 /Modules/_cursesmodule.c | |
parent | 9abe04975a1948f85c16896dcd68e7cf26bb593e (diff) | |
download | cpython-d2bc389e550464e3f71ec60071880335e8f9b6c6.zip cpython-d2bc389e550464e3f71ec60071880335e8f9b6c6.tar.gz cpython-d2bc389e550464e3f71ec60071880335e8f9b6c6.tar.bz2 |
Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r-- | Modules/_cursesmodule.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 54c724b..d64bdc7 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -2866,6 +2866,13 @@ update_lines_cols(void) Py_DECREF(m); return 1; } + +static PyObject * +PyCurses_update_lines_cols(PyObject *self) +{ + return PyLong_FromLong((long) update_lines_cols()); +} + #endif #ifdef HAVE_CURSES_RESIZETERM @@ -3268,6 +3275,9 @@ static PyMethodDef PyCurses_methods[] = { {"typeahead", (PyCFunction)PyCurses_TypeAhead, METH_VARARGS}, {"unctrl", (PyCFunction)PyCurses_UnCtrl, METH_VARARGS}, {"ungetch", (PyCFunction)PyCurses_UngetCh, METH_VARARGS}, +#if defined(HAVE_CURSES_RESIZETERM) || defined(HAVE_CURSES_RESIZE_TERM) + {"update_lines_cols", (PyCFunction)PyCurses_update_lines_cols, METH_NOARGS}, +#endif #ifdef HAVE_NCURSESW {"unget_wch", (PyCFunction)PyCurses_Unget_Wch, METH_VARARGS}, #endif |