]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
- add newtPopWindowNoRefresh()
authormlichvar <mlichvar>
Thu, 8 Feb 2007 19:13:49 +0000 (19:13 +0000)
committermlichvar <mlichvar>
Thu, 8 Feb 2007 19:13:49 +0000 (19:13 +0000)
newt.c
newt.h
snack.py
snackmodule.c

diff --git a/newt.c b/newt.c
index 84dff41096fec2761fe24228235b12993d0e9922..a74c10750504e7c2f179159dbbf03e3bc09fe47b 100644 (file)
--- 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 6ac75bb50d7df25d20da3495057e027f20ea9105..da16afe9e77ad8eedb8aed64269bf38a7a09bde0 100644 (file)
--- 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);
index 2fa0caa70f83feefaf8d0dd04ad790500979dfcf..1bd2424ae140ce4bf7dc11846cf962e9edf483f3 100644 (file)
--- 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()
index cc64f0ffa5d01dc65caa9234a3e8ce4aae1799d0..c71c2dfb03685b0a9dbef06704cc582f0b88fcf2 100644 (file)
@@ -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";