]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added returnexit for entry widget
authorewt <ewt>
Tue, 28 Oct 1997 16:35:30 +0000 (16:35 +0000)
committerewt <ewt>
Tue, 28 Oct 1997 16:35:30 +0000 (16:35 +0000)
snack.py
snackmodule.c

index a858145364aa1a3be3ce1c5de0c259f76dd82b5b..18d6871b8392990a3da66577af650a8ebdf163f4 100644 (file)
--- a/snack.py
+++ b/snack.py
@@ -91,8 +91,9 @@ class Entry(Widget):
     def set(self, text):
        return self.w.entrySetValue(text)
 
-    def __init__(self, width, text = "", hidden = 0, scroll = 1):
-       self.w = _snack.entry(width, text, hidden, scroll)
+    def __init__(self, width, text = "", hidden = 0, scroll = 1, 
+                returnexit = 0):
+       self.w = _snack.entry(width, text, hidden, scroll, returnexit)
 
 
 # Form uses hotkeys
index d60443a899508d64d0303919017d334c3b4974ef..1ee2d66798326e8d8f02ad86f4fc1d67fc10f2f8 100644 (file)
@@ -442,14 +442,15 @@ static snackWidget * entryWidget(PyObject * s, PyObject * args) {
     snackWidget * widget;
     int width;
     char * initial;
-    int isHidden, isScrolled;
+    int isHidden, isScrolled, returnExit;
 
     if (!PyArg_ParseTuple(args, "isii", &width, &initial,
-                         &isHidden, &isScrolled)) return NULL;
+                         &isHidden, &isScrolled, &returnExit)) return NULL;
 
     widget = PyObject_NEW(snackWidget, &snackWidgetType);
     widget->co = newtEntry(-1, -1, initial, width, (char **) &widget->apointer, 
                           (isHidden ? NEWT_FLAG_HIDDEN : 0) |
+                          (returnExit ? NEWT_FLAG_RETURNEXIT : 0) |
                           (!isScrolled ? NEWT_FLAG_NOSCROLL : 0));
 
     return widget;