def setup(self, stdscr):
self.stdscr = stdscr
# define curses color pairs
set_color_pairs()
# set getch to blocking
self.stdscr.nodelay(0)
# don't echo key strokes on the screen
curses.noecho()
# read keystrokes instantly, without waiting for enter to be pressed
curses.cbreak()
# enable keypad mode
self.stdscr.keypad(1)
# draw the main frame
self.setup_draw()
# find what's the erase character
self.del_char = curses.erasechar()
self.run()
评论列表
文章目录