aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2018-01-31 13:22:18 +0100
committerMarc André Tanner <mat@brain-dump.org>2020-02-24 11:15:24 +0100
commit30c6ceb2447be5b8b73958271972ba98457dc0b7 (patch)
tree53bcc5766ccfde78084a90628cae160dd8441c72 /vis-lua.c
parent15d213e4b6e33670cb50d472ad3f532245ebcc3b (diff)
downloadvis-30c6ceb2447be5b8b73958271972ba98457dc0b7.tar.gz
vis-30c6ceb2447be5b8b73958271972ba98457dc0b7.tar.xz
vis-lua: implement vis:redraw()
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 6948a12..53ffe59 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -1359,6 +1359,18 @@ static int pipe_func(lua_State *L) {
return 3;
}
/***
+ * Redraw complete user interface.
+ *
+ * Will trigger redraw events, make sure to avoid recursive events.
+ *
+ * @function draw
+ */
+static int redraw(lua_State *L) {
+ Vis *vis = obj_ref_check(L, 1, "vis");
+ vis_redraw(vis);
+ return 0;
+}
+/***
* Currently active window.
* @tfield Window win
* @see windows
@@ -1480,6 +1492,7 @@ static const struct luaL_Reg vis_lua[] = {
{ "action_register", action_register },
{ "exit", exit_func },
{ "pipe", pipe_func },
+ { "redraw", redraw },
{ "__index", vis_index },
{ "__newindex", vis_newindex },
{ NULL, NULL },