diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-20 19:20:12 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-20 19:20:12 +0200 |
| commit | aaefca67b304688efb0f4c893aab469d61f8f0bf (patch) | |
| tree | 8d3e3bff139d4ecf7172922c81772ba1909fbda3 /vis-lua.c | |
| parent | 5c1ce884dfec4fb361ea683ec818d6b4952bc841 (diff) | |
| download | vis-aaefca67b304688efb0f4c893aab469d61f8f0bf.tar.gz vis-aaefca67b304688efb0f4c893aab469d61f8f0bf.tar.xz | |
vis-lua: trigger start event after ui has been initialized
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -13,6 +13,7 @@ #if !CONFIG_LUA +void vis_lua_init(Vis *vis) { } void vis_lua_start(Vis *vis) { } void vis_lua_quit(Vis *vis) { } void vis_lua_file_open(Vis *vis, File *file) { } @@ -970,7 +971,7 @@ static bool vis_lua_path_add(Vis *vis, const char *path) { return true; } -void vis_lua_start(Vis *vis) { +void vis_lua_init(Vis *vis) { lua_State *L = luaL_newstate(); if (!L) return; @@ -1043,6 +1044,12 @@ void vis_lua_start(Vis *vis) { lua_getglobal(L, "require"); lua_pushstring(L, "visrc"); pcall(vis, L, 1, 0); +} + +void vis_lua_start(Vis *vis) { + lua_State *L = vis->lua; + if (!L) + return; vis_lua_event(vis, "start"); if (lua_isfunction(L, -1)) pcall(vis, L, 0, 0); |
