aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-08-20 16:08:48 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-08-24 11:10:00 +0200
commit928a55e2433a780d75f997ecc1f9ff956b6220d8 (patch)
tree0590e9c59d4a255f6c16510a5fdffceff0c1b17c /vis-lua.c
parentc0e86f811b3a8e4f45768db86e97d1b0fda5616f (diff)
downloadvis-928a55e2433a780d75f997ecc1f9ff956b6220d8.tar.gz
vis-928a55e2433a780d75f997ecc1f9ff956b6220d8.tar.xz
vis-lua: add win:draw() function
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 5aff161..56949fe 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -934,6 +934,13 @@ static int window_status(lua_State *L) {
return 0;
}
+static int window_draw(lua_State *L) {
+ Win *win = obj_ref_check(L, 1, "vis.window");
+ if (win)
+ view_draw(win->view);
+ return 0;
+}
+
static const struct luaL_Reg window_funcs[] = {
{ "__index", window_index },
{ "__newindex", window_newindex },
@@ -942,6 +949,7 @@ static const struct luaL_Reg window_funcs[] = {
{ "style_define", window_style_define },
{ "style", window_style },
{ "status", window_status },
+ { "draw", window_draw },
{ NULL, NULL },
};