]> git.neil.brown.name Git - edlib.git/commitdiff
Python: provide Pane.add_notify interface for pane_add_notify.
authorNeilBrown <neil@brown.name>
Fri, 25 Dec 2015 22:42:19 +0000 (09:42 +1100)
committerNeilBrown <neil@brown.name>
Fri, 25 Dec 2015 22:42:19 +0000 (09:42 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
lang-python.c

index c9f67fdf9ae66e0a6fffcd1126eb297db08d7b53..1e0df90603d821f5c31bb8be0e52cf364567d0ee 100644 (file)
@@ -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}
 };