def _history_selected(self, window, items, idx):
        """
        Called when a line was selected from the history popover.
        :param window: the history popover window
        :type window: tkinter.Toplevel
        :param items: list of lines in the history
        :type items: list of str
        :param idx: selected index
        :type idx: int
        """
        i = idx[0]
        window.destroy()
        line = items[i]
        self.history_selected(line, i)

        Called when a line was selected from the history popover.
        :param window: the history popover window
        :type window: tkinter.Toplevel
        :param items: list of lines in the history
        :type items: list of str
        :param idx: selected index
        :type idx: int
        
system/shui/tkui.py