def start_top_window(window, display):
window_lines, window_cols = window.getmaxyx()
bottom_line = window_lines - 1
window.bkgd(curses.A_NORMAL, curses.color_pair(2))
window.scrollok(1)
while True:
# alternate color pair used to visually check how frequently this loop runs
# to tell when user input is blocking
window.addstr(bottom_line, 1, display.recv_string())
window.move(bottom_line, 1)
window.scroll(1)
window.refresh()
评论列表
文章目录