(self, direction)
Scrolling the result window when pressing up/down arrow keys

        Args:
            direction: Up or Down

        Returns:
            None
Scrolling the result window when pressing up/down arrow keys
Scrolling the result window when pressing up / down arrow keys
def scroll(self, direction):
        """Scrolling the result window when pressing up/down arrow keys

        Args:
            direction: Up or Down

        Returns:
            None
        """
        next_line = self.current + direction

        # Up direction scroll overflow
        if (direction == self.UP) and (self.top > 0 and self.current == 0):
            self.top += direction
            return
        # Down direction scroll overflow
        if (direction == self.DOWN) and (next_line == self.max_lines) and (self.top + self.max_lines < self.bottom):
            self.top += direction
            return
        # Scroll up
        if (direction == self.UP) and (self.top > 0 or self.current > 0):
            self.current = next_line
            return
        # Scroll down
        if (direction == self.DOWN) and (next_line < self.max_lines) and (self.top + next_line < self.bottom):
            self.current = next_line
            return
def scroll ( self , direction ) : next_line = self . current + direction # Up direction scroll overflow if ( direction == self . UP ) and ( self . top > 0 and self . current == 0 ) : self . top += direction return # Down direction scroll overflow if ( direction == self . DOWN ) and ( next_line == self . max_lines ) and ( self . top + self . max_lines < self . bottom ) : self . top += direction return # Scroll up if ( direction == self . UP ) and ( self . top > 0 or self . current > 0 ) : self . current = next_line return # Scroll down if ( direction == self . DOWN ) and ( next_line < self . max_lines ) and ( self . top + next_line < self . bottom ) : self . current = next_line return