def _abs_cursor_pos_to_rel_pos(self, value, lines=None):
        """
        Convert an absolute cursor position (tuple of (int, int)) into a index relative to the start (int).
        'lines' are optional and specify a list of lines on which these calculations should be made.
        :param value: value to convert
        :type value: tuple of (int, int)
        :param lines: alternative lines to calculate position from (default: current lines)
        :type lines: list of str
        """
        if lines is None:
            # get lines
            lines = self.text.split("\n")
        row, column = value
        n = 0
        # first, add all lines before the current one
        for i in range(row):
            line = lines[i]
            n += len(line) + 1  # 1 for linebreak
        # add column
        n += column
        # done
        return n

        Convert an absolute cursor position (tuple of (int, int)) into a index relative to the start (int).
        'lines' are optional and specify a list of lines on which these calculations should be made.
        :param value: value to convert
        :type value: tuple of (int, int)
        :param lines: alternative lines to calculate position from (default: current lines)
        :type lines: list of str
        
system/shui/tkui.py