Since moving the cursor is visible if the cursor is visible, added btui_flush() calls after moving the cursor.
This commit is contained in:
parent
96336c2b86
commit
81430d869c
@ -25,6 +25,7 @@ static int Lbtui_enable(lua_State *L)
|
|||||||
if (bt == NULL) luaL_error(L, "Not a BTUI object");
|
if (bt == NULL) luaL_error(L, "Not a BTUI object");
|
||||||
*bt = btui_enable();
|
*bt = btui_enable();
|
||||||
btui_move_cursor(*bt, 0, 0);
|
btui_move_cursor(*bt, 0, 0);
|
||||||
|
btui_flush(*bt);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +152,7 @@ static int Lbtui_move(lua_State *L)
|
|||||||
int x = (int)luaL_checkinteger(L, 2);
|
int x = (int)luaL_checkinteger(L, 2);
|
||||||
int y = (int)luaL_checkinteger(L, 3);
|
int y = (int)luaL_checkinteger(L, 3);
|
||||||
btui_move_cursor(*bt, x, y);
|
btui_move_cursor(*bt, x, y);
|
||||||
|
btui_flush(*bt);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,6 +347,7 @@ static int Lbtui_wrap(lua_State *L)
|
|||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
*bt = btui_enable();
|
*bt = btui_enable();
|
||||||
btui_move_cursor(*bt, 0, 0);
|
btui_move_cursor(*bt, 0, 0);
|
||||||
|
btui_flush(*bt);
|
||||||
int status = lua_pcall(L, 1, 0, 0);
|
int status = lua_pcall(L, 1, 0, 0);
|
||||||
btui_disable(*bt);
|
btui_disable(*bt);
|
||||||
if (status != LUA_OK)
|
if (status != LUA_OK)
|
||||||
|
@ -178,6 +178,7 @@ class BTUI:
|
|||||||
def move(self, x, y):
|
def move(self, x, y):
|
||||||
assert self._btui
|
assert self._btui
|
||||||
libbtui.btui_move_cursor(self._btui, int(x), int(y))
|
libbtui.btui_move_cursor(self._btui, int(x), int(y))
|
||||||
|
libbtui.btui_flush(self._btui)
|
||||||
|
|
||||||
def hide_cursor(self):
|
def hide_cursor(self):
|
||||||
assert self._btui
|
assert self._btui
|
||||||
@ -248,6 +249,7 @@ _btui = BTUI()
|
|||||||
@contextmanager
|
@contextmanager
|
||||||
def open_btui():
|
def open_btui():
|
||||||
_btui.enable()
|
_btui.enable()
|
||||||
|
_btui.move(0, 0)
|
||||||
try: yield _btui
|
try: yield _btui
|
||||||
finally: _btui.disable()
|
finally: _btui.disable()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user