|
1 --- Python-2.7.3/Modules/_cursesmodule.c.orig 2012-09-27 10:17:54.934886883 -0700 |
|
2 +++ Python-2.7.3/Modules/_cursesmodule.c 2012-09-27 10:21:19.861160806 -0700 |
|
3 @@ -861,6 +861,37 @@ |
|
4 } |
|
5 |
|
6 static PyObject * |
|
7 +PyCursesWindow_Get_WCh(PyCursesWindowObject *self, PyObject *args) |
|
8 +{ |
|
9 + int x, y; |
|
10 + int ct; |
|
11 + wint_t rtn; |
|
12 + |
|
13 + switch (PyTuple_Size(args)) { |
|
14 + case 0: |
|
15 + Py_BEGIN_ALLOW_THREADS |
|
16 + ct = wget_wch(self->win,&rtn); |
|
17 + Py_END_ALLOW_THREADS |
|
18 + break; |
|
19 + case 2: |
|
20 + if (!PyArg_ParseTuple(args,"ii;y,x",&y,&x)) |
|
21 + return NULL; |
|
22 + Py_BEGIN_ALLOW_THREADS |
|
23 + ct = mvwget_wch(self->win,y,x,&rtn); |
|
24 + Py_END_ALLOW_THREADS |
|
25 + break; |
|
26 + default: |
|
27 + PyErr_SetString(PyExc_TypeError, "get_wch requires 0 or 2 arguments"); |
|
28 + return NULL; |
|
29 + } |
|
30 + if (ct == ERR) { |
|
31 + PyErr_SetString(PyCursesError, "get_wch failed"); |
|
32 + return NULL; |
|
33 + } |
|
34 + return PyInt_FromLong((long)rtn); |
|
35 +} |
|
36 + |
|
37 +static PyObject * |
|
38 PyCursesWindow_GetKey(PyCursesWindowObject *self, PyObject *args) |
|
39 { |
|
40 int x, y; |
|
41 @@ -1570,6 +1601,7 @@ |
|
42 {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS}, |
|
43 {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS}, |
|
44 {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS}, |
|
45 + {"get_wch", (PyCFunction)PyCursesWindow_Get_WCh, METH_VARARGS}, |
|
46 {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS}, |
|
47 {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS}, |
|
48 {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS}, |