]> granicus.if.org Git - python/commitdiff
Issue #5219: Prevent event handler cascade in IDLE.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 13 Mar 2012 21:46:22 +0000 (14:46 -0700)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 13 Mar 2012 21:46:22 +0000 (14:46 -0700)
Patch by Roger Serwy.

Lib/idlelib/CallTipWindow.py
Misc/NEWS

index 22238855c16ade9120fd2317b9f17fc8ad8530c9..7bb62b4e0b5c471653f185a58465fe32211abee8 100644 (file)
@@ -22,6 +22,7 @@ class CallTip:
         self.parenline = self.parencol = None
         self.lastline = None
         self.hideid = self.checkhideid = None
+        self.checkhide_after_id = None
 
     def position_window(self):
         """Check if needs to reposition the window, and if so - do it."""
@@ -102,7 +103,10 @@ class CallTip:
             self.hidetip()
         else:
             self.position_window()
-            self.widget.after(CHECKHIDE_TIME, self.checkhide_event)
+            if self.checkhide_after_id is not None:
+                self.widget.after_cancel(self.checkhide_after_id)
+            self.checkhide_after_id = \
+                self.widget.after(CHECKHIDE_TIME, self.checkhide_event)
 
     def hide_event(self, event):
         if not self.tipwindow:
index 6ef8376a9c46e9eebce978d9260b73fc14b36740..709d5be401225de764acf96b93def58117d29ab8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -20,6 +20,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #5219: Prevent event handler cascade in IDLE.
+
 - Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under
   Windows when the child process has already exited.