]> git.neil.brown.name Git - edlib.git/commitdiff
Python: add interface for pane_focus and pane_refresh.
authorNeilBrown <neil@brown.name>
Thu, 3 Dec 2015 22:52:16 +0000 (09:52 +1100)
committerNeilBrown <neil@brown.name>
Wed, 9 Dec 2015 09:02:59 +0000 (20:02 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
lang-python.c

index faa9037d6fbbc9e5f45ed9eaa62a0f1569cdaea2..94ae481a5b11a19407d8e76faf343b07ca34e02f 100644 (file)
@@ -203,6 +203,22 @@ static Pane *pane_children(Pane *self)
                                                     struct pane, siblings));
 }
 
+static PyObject *Pane_focus(Pane *self)
+{
+       if (self->pane)
+               pane_focus(self->pane);
+       Py_INCREF(Py_None);
+       return Py_None;
+}
+
+static PyObject *Pane_refresh(Pane *self)
+{
+       if (self->pane)
+               pane_refresh(self->pane);
+       Py_INCREF(Py_None);
+       return Py_None;
+}
+
 static Pane *pane_this(Pane *self)
 {
        return (Pane *)Pane_Frompane(self->pane);
@@ -225,6 +241,10 @@ static Pane *pane_next(Pane *self)
 static PyMethodDef pane_methods[] = {
        {"children", (PyCFunction)pane_children, METH_NOARGS,
         "provides and iterator which will iterate over all children"},
+       {"take_focus", (PyCFunction)Pane_focus, METH_NOARGS,
+        "Claim the focus for this pane"},
+       {"refresh", (PyCFunction)Pane_refresh, METH_NOARGS,
+        "Trigger refresh on this pane"},
        {NULL}
 };