diff --git a/Lua/lbtui.c b/Lua/lbtui.c index 0d227a2..ffedd34 100644 --- a/Lua/lbtui.c +++ b/Lua/lbtui.c @@ -25,6 +25,7 @@ static int Lbtui_enable(lua_State *L) if (bt == NULL) luaL_error(L, "Not a BTUI object"); *bt = btui_enable(); btui_move_cursor(*bt, 0, 0); + btui_flush(*bt); return 0; } @@ -151,6 +152,7 @@ static int Lbtui_move(lua_State *L) int x = (int)luaL_checkinteger(L, 2); int y = (int)luaL_checkinteger(L, 3); btui_move_cursor(*bt, x, y); + btui_flush(*bt); return 0; } @@ -345,6 +347,7 @@ static int Lbtui_wrap(lua_State *L) lua_setmetatable(L, -2); *bt = btui_enable(); btui_move_cursor(*bt, 0, 0); + btui_flush(*bt); int status = lua_pcall(L, 1, 0, 0); btui_disable(*bt); if (status != LUA_OK) diff --git a/Python/btui.py b/Python/btui.py index 735a4a8..e0dad7b 100644 --- a/Python/btui.py +++ b/Python/btui.py @@ -178,6 +178,7 @@ class BTUI: def move(self, x, y): assert self._btui libbtui.btui_move_cursor(self._btui, int(x), int(y)) + libbtui.btui_flush(self._btui) def hide_cursor(self): assert self._btui @@ -248,6 +249,7 @@ _btui = BTUI() @contextmanager def open_btui(): _btui.enable() + _btui.move(0, 0) try: yield _btui finally: _btui.disable()