def __init__(self):
_snack.init()
+ self.pushHelpLine(None)
def finish(self):
return _snack.finish()
def openWindow(self, left, top, width, height, title):
return _snack.openwindow(left, top, width, height, title)
+ def pushHelpLine(self, text):
+ if (not text):
+ return _snack.pushhelpline("*default*")
+ else:
+ return _snack.pushhelpline(text)
+
+ def popHelpLine(self):
+ return _snack.pophelpline()
+
+ def drawRootText(self, left, top, text):
+ return _snack.drawroottext(left, top, text)
+
def centeredWindow(self, width, height, title):
return _snack.centeredwindow(width, height, title)
static snackWidget * checkboxWidget(PyObject * s, PyObject * args);
static PyObject * choiceWindow(PyObject * s, PyObject * args);
static snackWidget * entryWidget(PyObject * s, PyObject * args);
+static PyObject * drawRootText(PyObject * s, PyObject * args);
static snackForm * formCreate(PyObject * s, PyObject * args);
static snackGrid * gridCreate(PyObject * s, PyObject * args);
static PyObject * gridWrappedWindow(PyObject * s, PyObject * args);
static snackWidget * listboxWidget(PyObject * s, PyObject * args);
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 * pushHelpLine(PyObject * s, PyObject * args);
static snackWidget * radioButtonWidget(PyObject * s, PyObject * args);
static PyObject * refreshScreen(PyObject * s, PyObject * args);
static PyObject * reflowText(PyObject * s, PyObject * args);
{ "checkbox", (PyCFunction) checkboxWidget, METH_VARARGS, NULL },
{ "choice", choiceWindow, METH_VARARGS, NULL },
{ "centeredwindow", centeredWindow, METH_VARARGS, NULL },
+ { "drawroottext", drawRootText, METH_VARARGS, NULL },
{ "entry", (PyCFunction) entryWidget, METH_VARARGS, NULL },
{ "finish", finishScreen, METH_VARARGS, NULL },
{ "form", (PyCFunction) formCreate, METH_VARARGS, NULL },
{ "listbox", (PyCFunction) listboxWidget, METH_VARARGS, NULL },
{ "message", messageWindow, METH_VARARGS, NULL },
{ "openwindow", openWindow, METH_VARARGS, NULL },
+ { "pophelpline", popHelpLine, METH_VARARGS, NULL },
{ "popwindow", popWindow, METH_VARARGS, NULL },
+ { "pushhelpline", pushHelpLine, METH_VARARGS, NULL },
{ "radiobutton", (PyCFunction) radioButtonWidget, METH_VARARGS, NULL },
{ "reflow", (PyCFunction) reflowText, METH_VARARGS, NULL },
{ "refresh", refreshScreen, METH_VARARGS, NULL },
return Py_None;
}
+static PyObject * drawRootText(PyObject * s, PyObject * args) {
+ int left, top;
+ char * text;
+
+ if (!PyArg_ParseTuple(args, "iis", &left, &top, &text))
+ return NULL;
+
+ newtDrawRootText(left, top, NULL);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject * popHelpLine(PyObject * s, PyObject * args) {
+ newtPopHelpLine();
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject * pushHelpLine(PyObject * s, PyObject * args) {
+ char * text;
+
+ if (!PyArg_ParseTuple(args, "s", &text))
+ return NULL;
+
+ if (!strcmp(text, "*default*"))
+ newtPushHelpLine(NULL);
+ else
+ newtPushHelpLine(text);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyObject * reflowText(PyObject * s, PyObject * args) {
char * text, * new;
int width, minus = 5, plus = 5;