Move reset() to text method.

Rearrange some other stuff.
This commit is contained in:
Simon Forman
2018-07-14 19:34:01 -07:00
parent 8bbf4fc2bf
commit ea11fbebda
2 changed files with 41 additions and 41 deletions
+9
View File
@@ -414,6 +414,15 @@ class TextViewerWidget(tk.Text, MouseBindingsMixin, SavingMixin):
self.repo = repo
self['font'] = font # See below.
def reset(self):
if os.path.exists(self.filename):
with open(self.filename) as f:
data = f.read()
if data:
self.delete('0.0', tk.END)
self.insert(tk.END, data)
def popupTB(self, tb):
top = tk.Toplevel()
T = TextViewerWidget(