]> granicus.if.org Git - python/commitdiff
SF bug 546078: IDLE calltips cause application error.
authorTim Peters <tim.peters@gmail.com>
Mon, 22 Apr 2002 18:43:49 +0000 (18:43 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 22 Apr 2002 18:43:49 +0000 (18:43 +0000)
Assorted crashes on Windows and Linux when trying to display a very
long calltip, most likely a Tk bug.  Wormed around by clamping the
calltip display to a maximum of 79 characters (why 79? why not ...).

Bugfix candidate, for all Python releases.

Tools/idle/CallTipWindow.py

index d253fa5969a9cb3a5161f6b67bb05ac5bc3ca3ef..db1e346c55dc54433299c042695d7bb31629af1e 100644 (file)
@@ -14,7 +14,13 @@ class CallTip:
         self.x = self.y = 0
 
     def showtip(self, text):
+        # SF bug 546078:  IDLE calltips cause application error.
+        # There were crashes on various Windows flavors, and even a
+        # crashing X server on Linux, with very long calltips.
+        if len(text) >= 79:
+            text = text[:75] + ' ...'
         self.text = text
+
         if self.tipwindow or not self.text:
             return
         self.widget.see("insert")