From 5a8da88081f3c3ee415dfc1cd13b5422fbd68510 Mon Sep 17 00:00:00 2001 From: ewt Date: Tue, 28 Oct 1997 16:35:30 +0000 Subject: [PATCH] added returnexit for entry widget --- snack.py | 5 +++-- snackmodule.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/snack.py b/snack.py index a858145..18d6871 100644 --- 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 diff --git a/snackmodule.c b/snackmodule.c index d60443a..1ee2d66 100644 --- a/snackmodule.c +++ b/snackmodule.c @@ -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; -- 2.47.2