UICurse.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:rogueinabox 作者: rogueinabox 项目源码 文件源码
def _start_ui(self, stdscr):
        """TODO docs"""
        rogue_height = 26
        rogue_width = 84
        # using a pad instead of the default win, it's safer
        self.stdscr = curses.newpad(rogue_height, rogue_width)
        self.stdscr.nodelay(True)
        curses.curs_set(False)
        self.draw_from_rogue()
        minlogsize = 4
        if curses.LINES - 1 >= rogue_height + minlogsize:
            # there's enough space to show the logs
            self.logpad = curses.newpad(curses.LINES - 1, curses.COLS - 1)
        while True:
            if self.timer_callback:
                self.timer_callback()
                time.sleep(self.sleep_time)
            if self.keypress_callback:
                try:
                    key = self.stdscr.getkey()
                    event = Event()
                    event.char = key
                    self.keypress_callback(event)
                except curses.error:
                    pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号