Index: Modules/_cursesmodule.c =================================================================== --- Modules/_cursesmodule.c (revision 69967) +++ Modules/_cursesmodule.c (working copy) @@ -715,7 +715,23 @@ return PyCursesCheckERR(rtn, "chgat"); } +/* Inserted Steve Owens 2/24/4009 */ +static PyObject * +PyCursesWindow_wcolor_set(PyCursesWindowObject *self, PyObject *args) +{ + short color_pair_number; + void * opts; + int erg; + PyCursesInitialised + PyCursesInitialisedColor + + if (!PyArg_ParseTuple(args, "h:wcolor_set", &color_pair_number)) return NULL; + + return PyCursesCheckERR(wcolor_set(self->win, color_pair_number, NULL), "wcolor_set"); // Debating on forcing null here. +} + + static PyObject * PyCursesWindow_DelCh(PyCursesWindowObject *self, PyObject *args) { @@ -1548,6 +1564,7 @@ {"clearok", (PyCFunction)PyCursesWindow_clearok, METH_VARARGS}, {"clrtobot", (PyCFunction)PyCursesWindow_wclrtobot, METH_NOARGS}, {"clrtoeol", (PyCFunction)PyCursesWindow_wclrtoeol, METH_NOARGS}, + {"color_set", (PyCFunction)PyCursesWindow_wcolor_set, METH_VARARGS}, {"cursyncup", (PyCFunction)PyCursesWindow_wcursyncup, METH_NOARGS}, {"delch", (PyCFunction)PyCursesWindow_DelCh, METH_VARARGS}, {"deleteln", (PyCFunction)PyCursesWindow_wdeleteln, METH_NOARGS}, @@ -1721,7 +1738,26 @@ return PyInt_FromLong((long) (n << 8)); } +/* + Insert new method color_set Steve Owens 2/24/2009 + The curses library color_set function has the following signature: + int color_set(short color_pair_number, void* opts); + opts is reserved for future use and must be set to NULL +*/ static PyObject * +PyCurses_color_set(PyObject *self, PyObject *args) +{ + short color_pair_number = 0; + + PyCursesInitialised + PyCursesInitialisedColor + + if (!PyArg_ParseTuple(args, "h:color_set", &color_pair_number)) return NULL; + + return PyCursesCheckERR(color_set(color_pair_number, NULL), "color_set"); +} + +static PyObject * PyCurses_Curs_Set(PyObject *self, PyObject *args) { int vis,erg; @@ -2631,6 +2667,7 @@ {"cbreak", (PyCFunction)PyCurses_cbreak, METH_VARARGS}, {"color_content", (PyCFunction)PyCurses_Color_Content, METH_VARARGS}, {"color_pair", (PyCFunction)PyCurses_color_pair, METH_VARARGS}, + {"color_set", (PyCFunction)PyCurses_color_set, METH_VARARGS}, {"curs_set", (PyCFunction)PyCurses_Curs_Set, METH_VARARGS}, {"def_prog_mode", (PyCFunction)PyCurses_def_prog_mode, METH_NOARGS}, {"def_shell_mode", (PyCFunction)PyCurses_def_shell_mode, METH_NOARGS},