From 30c6ceb2447be5b8b73958271972ba98457dc0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 31 Jan 2018 13:22:18 +0100 Subject: vis-lua: implement vis:redraw() --- vis-lua.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index 6948a12..53ffe59 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -1358,6 +1358,18 @@ static int pipe_func(lua_State *L) { vis_draw(vis); 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 @@ -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 }, -- cgit v1.2.3