mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 18:37:50 +00:00
Expose pause_rendering to Python
This commit is contained in:
parent
e0374ee623
commit
cf0a5fb607
2 changed files with 11 additions and 0 deletions
|
|
@ -1217,6 +1217,7 @@ class Screen:
|
|||
def change_pointer_shape(self, op: str, name: str) -> None: ...
|
||||
|
||||
def bell(self) -> None: ...
|
||||
def pause_rendering(self, pause: bool = True, for_how_long_in_ms: int = 100) -> bool: ...
|
||||
|
||||
def set_tab_bar_render_data(
|
||||
os_window_id: int, screen: Screen, left: int, top: int, right: int, bottom: int
|
||||
|
|
|
|||
|
|
@ -4383,6 +4383,15 @@ toggle_alt_screen(Screen *self, PyObject *a UNUSED) {
|
|||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
pause_rendering(Screen *self, PyObject *args) {
|
||||
int msec = 100;
|
||||
int pause = 1;
|
||||
if (!PyArg_ParseTuple(args, "|pi", &msec)) return NULL;
|
||||
if (screen_pause_rendering(self, pause, msec)) Py_RETURN_TRUE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
send_escape_code_to_child(Screen *self, PyObject *args) {
|
||||
int code;
|
||||
|
|
@ -4774,6 +4783,7 @@ static PyMethodDef methods[] = {
|
|||
MND(scroll, METH_VARARGS)
|
||||
MND(scroll_to_prompt, METH_VARARGS)
|
||||
MND(send_escape_code_to_child, METH_VARARGS)
|
||||
MND(pause_rendering, METH_VARARGS)
|
||||
MND(hyperlink_at, METH_VARARGS)
|
||||
MND(toggle_alt_screen, METH_NOARGS)
|
||||
MND(reset_callbacks, METH_NOARGS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue