From d2dac5992ce7e47fa194f2288559fffc18a395ed Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 26 Dec 2015 09:42:19 +1100 Subject: [PATCH] Python: provide Pane.add_notify interface for pane_add_notify. Signed-off-by: NeilBrown --- lang-python.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lang-python.c b/lang-python.c index c9f67fdf..1e0df906 100644 --- a/lang-python.c +++ b/lang-python.c @@ -397,6 +397,19 @@ static PyObject *Pane_abs(Pane *self, PyObject *args) return Py_BuildValue("ii", x, y); } +static PyObject *Pane_add_notify(Pane *self, PyObject *args) +{ + Pane *other = NULL; + char *event = NULL; + int ret = PyArg_ParseTuple(args, "O!s", &PaneType, &other, &event); + if (ret <= 0) + return NULL; + pane_add_notify(self->pane, other->pane, event); + + Py_INCREF(Py_None); + return Py_None; +} + static PyObject *Pane_rel(Pane *self, PyObject *args) { int x,y; @@ -426,6 +439,8 @@ static PyMethodDef pane_methods[] = { "Convert pane-relative co-ords to absolute co-ords"}, {"rel", (PyCFunction)Pane_rel, METH_VARARGS, "Convert absolute co-orders to pane-relative"}, + {"add_notify", (PyCFunction)Pane_add_notify, METH_VARARGS, + "Add notified for an event on some other pane"}, {NULL} }; -- 2.39.5