def refresh(self, drawList, cursor):
"""Repaint stacked windows, furthest to nearest in the main thread."""
# Ask curses to hold the back buffer until curses refresh().
cursesWindow = app.window.mainCursesWindow
cursesWindow.noutrefresh()
curses.curs_set(0)
#drawList, cursor = app.render.frame.grabFrame()
for i in drawList:
try:
cursesWindow.addstr(*i)
except:
#app.log.error('failed to draw', repr(i))
pass
if cursor is not None:
curses.curs_set(1)
try:
cursesWindow.leaveok(0) # Do update cursor position.
cursesWindow.move(cursor[0], cursor[1])
# Calling refresh will draw the cursor.
cursesWindow.refresh()
cursesWindow.leaveok(1) # Don't update cursor position.
except:
pass
评论列表
文章目录