/* Python function that writes some text to a TUI window. */
static PyObject *
-gdbpy_tui_write (PyObject *self, PyObject *args)
+gdbpy_tui_write (PyObject *self, PyObject *args, PyObject *kw)
{
+ static const char *keywords[] = { "string", "full_window", nullptr };
+
gdbpy_tui_window *win = (gdbpy_tui_window *) self;
const char *text;
int full_window = 0;
- if (!PyArg_ParseTuple (args, "s|i", &text, &full_window))
+ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s|i", keywords,
+ &text, &full_window))
return nullptr;
REQUIRE_WINDOW (win);
Return true if this TUI window is valid, false if not." },
{ "erase", gdbpy_tui_erase, METH_NOARGS,
"Erase the TUI window." },
- { "write", (PyCFunction) gdbpy_tui_write, METH_VARARGS,
+ { "write", (PyCFunction) gdbpy_tui_write, METH_VARARGS | METH_KEYWORDS,
"Append a string to the TUI window." },
{ NULL } /* Sentinel. */
};
self.win.erase()
w = self.win.width
h = self.win.height
- self.win.write("Test: " + str(self.count) + " " + str(w) + "x" + str(h))
+ self.win.write(string="Test: " + str(self.count) + " " + str(w) + "x" + str(h),
+ full_window=False)
self.count = self.count + 1
# Tries to delete the title attribute. GDB will throw an error.