(self)
Method to initialize curses functionality
Method to initialize curses functionality
Method to initialize curses functionality
def initialize_cur(self):
        '''Method to initialize curses functionality'''

        self.stdscr = cur.initscr()
        try:
            cur.curs_set(0)
        except:
            print('Invisible cursor not supported')
        cur.cbreak()
        cur.noecho()
        self.stdscr.keypad(1)
        cur.start_color()
        cur.use_default_colors()
        cur.init_pair(1, -1, -1)
        cur.init_pair(2, 2, -1)
        cur.init_pair(3, -1, 1)
        cur.init_pair(4, 6, -1)
        cur.init_pair(5, 0, 6)
        cur.init_pair(6, 0, 7)
        cur.init_pair(7, 1, -1)
        self.stdscr.bkgd(1)
        self.ysize, self.xsize = self.stdscr.getmaxyx()

        self.group_win = cur.newwin(self.ysize - 1, int(self.xsize / 3),
                                    1, 0)
        # 11 is the y size of info_win
        self.entry_win = cur.newwin((self.ysize - 1) - 11,
                                    int(2 * self.xsize / 3),
                                    1, int(self.xsize / 3))
        self.info_win = cur.newwin(11,
                                   int(2 * self.xsize / 3),
                                   (self.ysize - 1) - 11,
                                   int(self.xsize / 3))
        self.group_win.keypad(1)
        self.entry_win.keypad(1)
        self.group_win.bkgd(1)
        self.entry_win.bkgd(1)
        self.info_win.bkgd(1)
def initialize_cur ( self ) : self . stdscr = cur . initscr ( ) try : cur . curs_set ( 0 ) except : print ( 'Invisible cursor not supported' ) cur . cbreak ( ) cur . noecho ( ) self . stdscr . keypad ( 1 ) cur . start_color ( ) cur . use_default_colors ( ) cur . init_pair ( 1 , - 1 , - 1 ) cur . init_pair ( 2 , 2 , - 1 ) cur . init_pair ( 3 , - 1 , 1 ) cur . init_pair ( 4 , 6 , - 1 ) cur . init_pair ( 5 , 0 , 6 ) cur . init_pair ( 6 , 0 , 7 ) cur . init_pair ( 7 , 1 , - 1 ) self . stdscr . bkgd ( 1 ) self . ysize , self . xsize = self . stdscr . getmaxyx ( ) self . group_win = cur . newwin ( self . ysize - 1 , int ( self . xsize / 3 ) , 1 , 0 ) # 11 is the y size of info_win self . entry_win = cur . newwin ( ( self . ysize - 1 ) - 11 , int ( 2 * self . xsize / 3 ) , 1 , int ( self . xsize / 3 ) ) self . info_win = cur . newwin ( 11 , int ( 2 * self . xsize / 3 ) , ( self . ysize - 1 ) - 11 , int ( self . xsize / 3 ) ) self . group_win . keypad ( 1 ) self . entry_win . keypad ( 1 ) self . group_win . bkgd ( 1 ) self . entry_win . bkgd ( 1 ) self . info_win . bkgd ( 1 )