From 2a5e350265ccc3c8ffe2f3cc66854f4a341da432 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Wed, 18 Sep 2002 03:26:47 +0000 Subject: Merge Py Idle changes: Rev 1.6 GvR Finally fix SF bug #441172, using a variant of patch ##443626: canceling an edit operation would not revert the value of the field. The fix takes care to destroy the Entry object, as suggested in the patch. Rev 1.7 Geiger Ho / GvR (previously applied - Idlefork Rev 1.3) Rev 1.8 doerwalter (string methods) --- Lib/idlelib/TreeWidget.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py index ebc7be0..d713264 100644 --- a/Lib/idlelib/TreeWidget.py +++ b/Lib/idlelib/TreeWidget.py @@ -16,7 +16,6 @@ import os import sys -import string from Tkinter import * import imp @@ -291,6 +290,12 @@ class TreeNode: self.canvas.focus_set() def edit_cancel(self, event=None): + try: + entry = self.entry + del self.entry + except AttributeError: + return + entry.destroy() self.drawtext() self.canvas.focus_set() -- cgit v0.12