def _user_text_delete(self, index1, index2=None, **kw): if (self._editing_allowed() and self._in_current_input_range(index1) and (index2 is None or self._in_current_input_range(index2))): TextWrapper._user_text_delete(self, index1, index2, **kw) else: self.bell() print("Shell: can't delete", self._get_state())
def set_content(self, content): TextWrapper._user_text_delete(self, "1.0", tk.END) TextWrapper._user_text_insert(self, "1.0", content) self._update_line_numbers() self.text.edit_reset() if self.colorer: self.colorer.notify_range("1.0", "end") self.update_level_boxes()
def _user_text_delete(self, index1, index2=None): # cursor_pos = self.text.index(tk.INSERT) if self.read_only: self.bell() print("CodeView._user_text_insert, read only") # self._show_read_only_warning() else: TextWrapper._user_text_delete(self, index1, index2) if self.colorer: self.colorer.on_delete(index1, index2) self._update_line_numbers() self.update_level_boxes()