return hotkeys[which]
+ def draw(self):
+ self.w.draw()
+ return None
+
def __init__(self):
self.trans = {}
self.w = _snack.form()
self.screen.popWindow()
return result
- def run(self):
+ def create(self):
if not self.form_created:
self.place(1,1)
for child in self.childList:
self.form.add(child)
self.screen.gridWrappedWindow(self, self.title)
self.form_created = 1
+
+ def run(self):
+ self.create()
return self.form.run()
+
+ def draw(self):
+ self.create()
+ return self.form.draw()
def runPopup(self):
- if not self.form_created:
- self.place(1,1)
- for child in self.childList:
- self.form.add(child)
- self.form_created = 1
+ self.create()
self.screen.gridWrappedWindow(self, self.title)
result = self.form.run()
self.screen.popWindow()
static PyObject * formGetAttr(PyObject * s, char * name);
static PyObject * formAdd(snackForm * s, PyObject * args);
+static PyObject * formDraw(snackForm * s, PyObject * args);
static PyObject * formRun(snackForm * s, PyObject * args);
static PyObject * formHotKey(snackForm * s, PyObject * args);
static PyMethodDef formMethods[] = {
{ "add", (PyCFunction) formAdd, METH_VARARGS, NULL },
+ { "draw", (PyCFunction) formDraw, METH_VARARGS, NULL },
{ "run", (PyCFunction) formRun, METH_VARARGS, NULL },
{ "addhotkey", (PyCFunction) formHotKey, METH_VARARGS, NULL },
{ NULL }
return Py_FindMethod(formMethods, s, name);
}
+static PyObject * formDraw(snackForm * s, PyObject * args) {
+ newtDrawForm(s->fo);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyObject * formAdd(snackForm * s, PyObject * args) {
snackWidget * w;
int size = PyTuple_Size(args), i;