From: mlichvar Date: Thu, 8 Feb 2007 19:13:49 +0000 (+0000) Subject: - add newtPopWindowNoRefresh() X-Git-Tag: r0-52-6~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5df813befcbd3e5e7e0342540bc29447ce570f7;p=thirdparty%2Fnewt.git - add newtPopWindowNoRefresh() --- diff --git a/newt.c b/newt.c index 84dff41..a74c107 100644 --- a/newt.c +++ b/newt.c @@ -725,6 +725,11 @@ int newtCenteredWindow(unsigned int width,unsigned int height, * @brief Remove the top window */ void newtPopWindow(void) { + newtPopWindowNoRefresh(); + newtRefresh(); +} + +void newtPopWindowNoRefresh(void) { int j, row, col; int n = 0; @@ -754,8 +759,6 @@ void newtPopWindow(void) { SLsmg_set_char_set(0); newtTrashScreen(); - - newtRefresh(); } void newtGetWindowPos(int * x, int * y) { diff --git a/newt.h b/newt.h index 6ac75bb..da16afe 100644 --- a/newt.h +++ b/newt.h @@ -120,6 +120,7 @@ int newtOpenWindow(int left,int top, const char * title); int newtCenteredWindow(unsigned int width,unsigned int height, const char * title); void newtPopWindow(void); +void newtPopWindowNoRefresh(void); void newtSetColors(struct newtColors colors); void newtRefresh(void); void newtSuspend(void); diff --git a/snack.py b/snack.py index 2fa0caa..1bd2424 100644 --- a/snack.py +++ b/snack.py @@ -460,8 +460,10 @@ class SnackScreen: return _snack.gridwrappedwindow(grid.g, title) - def popWindow(self): - return _snack.popwindow() + def popWindow(self, refresh = True): + if refresh: + return _snack.popwindow() + return _snack.popwindownorefresh() def refresh(self): return _snack.refresh() diff --git a/snackmodule.c b/snackmodule.c index cc64f0f..c71c2df 100644 --- a/snackmodule.c +++ b/snackmodule.c @@ -53,6 +53,7 @@ static PyObject * messageWindow(PyObject * s, PyObject * args); static PyObject * openWindow(PyObject * s, PyObject * args); static PyObject * popHelpLine(PyObject * s, PyObject * args); static PyObject * popWindow(PyObject * s, PyObject * args); +static PyObject * popWindowNoRefresh(PyObject * s, PyObject * args); static PyObject * pushHelpLine(PyObject * s, PyObject * args); static snackWidget * radioButtonWidget(PyObject * s, PyObject * args); static PyObject * refreshScreen(PyObject * s, PyObject * args); @@ -87,6 +88,7 @@ static PyMethodDef snackModuleMethods[] = { { "openwindow", openWindow, METH_VARARGS, NULL }, { "pophelpline", popHelpLine, METH_VARARGS, NULL }, { "popwindow", popWindow, METH_VARARGS, NULL }, + { "popwindownorefresh", popWindowNoRefresh, METH_VARARGS, NULL }, { "pushhelpline", pushHelpLine, METH_VARARGS, NULL }, { "radiobutton", (PyCFunction) radioButtonWidget, METH_VARARGS, NULL }, { "reflow", (PyCFunction) reflowText, METH_VARARGS, NULL }, @@ -530,6 +532,12 @@ static PyObject * popWindow(PyObject * s, PyObject * args) { return Py_None; } +static PyObject * popWindowNoRefresh(PyObject * s, PyObject * args) { + newtPopWindowNoRefresh(); + Py_INCREF(Py_None); + return Py_None; +} + static PyObject * messageWindow(PyObject * s, PyObject * args) { char * title, * text; char * okbutton = "Ok";