コード例 #1
0
    def __RenderWindow(self, stdscr):
        ch = CursesHelper()
        ch.stdscr = stdscr
        ch.SetCharacterBlockingMode(False)

        ch.WindowClear()
        ch.WindowRefresh()

        curses.start_color()
        curses.init_pair(1, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
        curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK)
        curses.init_pair(3, curses.COLOR_BLACK, curses.COLOR_WHITE)
        while ch.key != curses.KEY_F12:
            ch.WindowClear()
            ch.CursorMove()

            self.__InsertHeader(stdscr)
            self.__InsertColHeader(stdscr, ch.width)
            self.__InsertLines(stdscr, ch.height, ch.width)
            self.__InsertFooter(stdscr, ch)

            ch.WindowRefresh()
            ch.GetCharacter()

        ch.WindowClose()
コード例 #2
0
    def __TuiHelp(self, stdscr):
        h = uiHelp()
        h.Start()

        ch = CursesHelper()
        curses.halfdelay(10)
        ch.stdscr = stdscr
        ch.SetCharacterBlockingMode(True)
        ch.WindowClear()
        ch.WindowRefresh()
        ch.key = 0
        return ch
コード例 #3
0
    def __TuiLogs(self, stdscr):
        l = uiLogs()
        l.logs = self.logs
        l.Start()

        # Once we come back here, update ch with the current stdscr
        # Helps to make the window accept input again
        ch = CursesHelper()
        curses.halfdelay(10)
        ch.stdscr = stdscr
        ch.SetCharacterBlockingMode(True)
        ch.WindowClear()
        ch.WindowRefresh()
        ch.key = 0
        return ch