def copy_selection_to_clipboard(self): # () '''Copy the text in the region to the windows clipboard.''' if self.enable_win32_clipboard and self.enable_selection and self.selection_mark >= 0: selection_mark = min(self.selection_mark, len(self.line_buffer)) cursor = min(self.point, len(self.line_buffer)) if self.selection_mark == -1: return begin = min(cursor, selection_mark) end = max(cursor, selection_mark) toclipboard = "".join(self.line_buffer[begin:end]) clipboard.SetClipboardText(toclipboard)
def copy_region_to_clipboard(self): # () """Copy the text in the region to the windows clipboard.""" if self.enable_win32_clipboard: mark = min(self.mark, len(self.line_buffer)) cursor = min(self.point, len(self.line_buffer)) if self.mark == -1: return begin = min(cursor, mark) end = max(cursor, mark) toclipboard = "".join(self.line_buffer[begin:end]) clipboard.SetClipboardText(toclipboard)
def add_to_kill_ring(self, txt): self.kill_ring = [txt] if kill_ring_to_clipboard: clipboard.SetClipboardText(txt.get_line_text())